-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(digitalTwin): add support modify mapping
- Loading branch information
Showing
6 changed files
with
83 additions
and
15 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
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
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
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
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
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,43 @@ | ||
import { JSONObject } from "kuzzle-sdk"; | ||
import { useSdk } from "../helpers"; | ||
import { beforeAllCreateEngines } from "../hooks/engines"; | ||
|
||
describe("Assets mapping", () => { | ||
const sdk = useSdk(); | ||
|
||
beforeAll(async () => { | ||
await sdk.connect(); | ||
|
||
await beforeAllCreateEngines(sdk); | ||
}); | ||
|
||
afterAll(async () => { | ||
sdk.disconnect(); | ||
}); | ||
|
||
it("asset mapping can be customize by application", async () => { | ||
const mapping: JSONObject = await sdk.collection.getMapping( | ||
"engine-ayse", | ||
"assets" | ||
); | ||
|
||
expect(mapping.properties?.softTenant).toBeDefined(); | ||
expect(mapping.properties.softTenant).toMatchObject({ | ||
type: "keyword", | ||
fields: { text: { type: "text" } }, | ||
}); | ||
}); | ||
|
||
it("device mapping can be customize by application", async () => { | ||
const mapping: JSONObject = await sdk.collection.getMapping( | ||
"engine-ayse", | ||
"devices" | ||
); | ||
|
||
expect(mapping.properties?.softTenant).toBeDefined(); | ||
expect(mapping.properties.softTenant).toMatchObject({ | ||
type: "keyword", | ||
fields: { text: { type: "text" } }, | ||
}); | ||
}); | ||
}); |