Skip to content
This repository has been archived by the owner on Dec 23, 2021. It is now read-only.

Commit

Permalink
chore: add test for filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Soontao committed Sep 21, 2020
1 parent 7e7accd commit 01f379f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 35 deletions.
32 changes: 0 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
},
"devDependencies": {
"@odata/client": "^2.10.2",
"@sap/hana-client": "^2.5.109",
"@types/body-parser": "1.19.0",
"@types/cors": "^2.8.7",
"@types/debug": "^4.1.5",
Expand All @@ -79,7 +78,6 @@
"eslint": "^7.9.0",
"eslint-plugin-es-beautifier": "^1.0.1",
"event-stream": "^4.0.1",
"hdb-pool": "^0.1.6",
"jest": "^26.4.2",
"mongodb": "^3.6.2",
"pg": "^8.3.3",
Expand Down
34 changes: 33 additions & 1 deletion test/type/relationship.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IncKeyProperty, ODataModel, ODataNavigation, OptionalProperty } from '../../src';
import { IncKeyProperty, ODataModel, ODataNavigation, OptionalProperty, UUIDKeyProperty } from '../../src';
import { createServerAndClient, createTmpConnection } from './utils';


Expand Down Expand Up @@ -47,4 +47,36 @@ describe('RelationShip Test Suite', () => {

});

it('should support uuid filter', async () => {

@ODataModel()
class UUIDObject {
@UUIDKeyProperty() id: string;
@OptionalProperty() name: string;
}

const conn = await createTmpConnection({
name: 'relationship_test',
entityPrefix: 'unit_rel_01_',
entities: [UUIDObject]
});

const { client, shutdownServer } = await createServerAndClient(conn, UUIDObject);

try {

const objects = client.getEntitySet<UUIDObject>('UUIDObjects');

const { id } = await objects.create({ name: 'name1' });
expect(id).not.toBeUndefined();

const items = await objects.find({ id });
expect(items).toHaveLength(1);

} finally {
await shutdownServer();
}

});

});

0 comments on commit 01f379f

Please sign in to comment.