generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
packages/odata-service-inquirer/test/unit/prompts/metadata-file/fixtures/validatorTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<edmx:Edmx Version="1.0" | ||
xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx"> | ||
<edmx:DataServices m:DataServiceVersion="1.0" m:MaxDataServiceVersion="3.0" | ||
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"> | ||
<Schema Namespace="NorthwindModel" | ||
xmlns="http://schemas.microsoft.com/ado/2008/09/edm"> | ||
<EntityType Name="Category"> | ||
<Key> | ||
<PropertyRef Name="CategoryID" /> | ||
</Key> | ||
<Property Name="CategoryID" Type="Edm.Int32" Nullable="false" p6:StoreGeneratedPattern="Identity" | ||
xmlns:p6="http://schemas.microsoft.com/ado/2009/02/edm/annotation" /> | ||
<Property Name="CategoryName" Type="Edm.String" Nullable="false" MaxLength="15" FixedLength="false" Unicode="true" /> | ||
<Property Name="Description" Type="Edm.String" MaxLength="Max" FixedLength="false" Unicode="true" /> | ||
<Property Name="Picture" Type="Edm.Binary" MaxLength="Max" FixedLength="false" /> | ||
<NavigationProperty Name="Products" Relationship="NorthwindModel.FK_Products_Categories" ToRole="Products" FromRole="Categories" /> | ||
</EntityType> | ||
<Annotation Term="UI.Facets"> | ||
<Collection> | ||
<Record Type="UI.CollectionFacet"> | ||
<PropertyValue Property="Label" String="Terms & Conditions" /> | ||
</Record> | ||
</Collection> | ||
</Annotation> | ||
</Schema> | ||
</edmx:DataServices> | ||
</edmx:Edmx> |
12 changes: 12 additions & 0 deletions
12
packages/odata-service-inquirer/test/unit/prompts/metadata-file/validators.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import path from 'path'; | ||
import { validateMetadataFile } from '../../../../src/prompts/datasources/metadata-file/validators'; | ||
|
||
describe('metadata valiadtors', () => { | ||
test('validateMetadataFile', async () => { | ||
const testXmlPath = path.join(__dirname, 'fixtures/validatorTest.xml'); | ||
expect(await validateMetadataFile(testXmlPath)).toMatchObject({ | ||
version: '2', | ||
metadata: expect.stringContaining('Terms & Conditions') //Ensure that the & is replaced with & | ||
}); | ||
}); | ||
}); |