-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from tago-io/fix/newBuckets
APPDEV-2 Fix/new buckets
- Loading branch information
Showing
29 changed files
with
8,286 additions
and
16,403 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,3 +51,5 @@ yarn.lock | |
# ignore local files | ||
*.LOCAL.* | ||
*.local.* | ||
.tago-lock.tago.lock | ||
.tagoio |
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,39 @@ | ||
import { IExportHolder } from "../exportTypes"; | ||
import { getExportHolder } from "./collectIDs"; | ||
|
||
describe("Collect ID", () => { | ||
test("Get Export Holder - Devices", () => { | ||
const list = [ | ||
{ id: "Test1", token: "1234-1234-1234-1234", tags: [{ key: "export_id", value: "config_dev" }] }, | ||
{ id: "Test2", token: "1235-1235-1235-1235", tags: [{ key: "export_id", value: "other_dev" }] }, | ||
]; | ||
|
||
const import_list = [ | ||
{ id: "1Test", token: "4321-4321-4321-4321", tags: [{ key: "export_id", value: "config_dev" }] }, | ||
{ id: "2Test", token: "5321-5321-5321-5321", tags: [{ key: "export_id", value: "other_dev" }] }, | ||
]; | ||
|
||
const exportHolder: IExportHolder = { devices: {}, analysis: {}, dashboards: {}, tokens: {} }; | ||
|
||
getExportHolder(list, import_list, "devices", exportHolder); | ||
|
||
expect(exportHolder.devices).toStrictEqual({ Test1: "1Test", Test2: "2Test" }); | ||
expect(exportHolder.tokens).toStrictEqual({ "1234-1234-1234-1234": "4321-4321-4321-4321", "1235-1235-1235-1235": "5321-5321-5321-5321" }); | ||
}); | ||
|
||
test("Get Export Holder - Devices Token not Found", () => { | ||
const list = [ | ||
{ id: "Test1", token: "1234-1234-1234-1234", tags: [{ key: "export_id", value: "config_dev" }] }, | ||
{ id: "Test2", token: "1235-1235-1235-1235", tags: [{ key: "export_id", value: "other_dev" }] }, | ||
]; | ||
|
||
const import_list = [ | ||
{ id: "1Test", name: "1Test", tags: [{ key: "export_id", value: "config_dev" }] }, | ||
{ id: "2Test", token: "5321-5321-5321-5321", tags: [{ key: "export_id", value: "other_dev" }] }, | ||
]; | ||
|
||
const exportHolder: IExportHolder = { devices: {}, analysis: {}, dashboards: {}, tokens: {} }; | ||
|
||
expect(() => Promise.reject(getExportHolder(list, import_list, "devices", exportHolder))).toThrow("Device Token not found: 1Test [1Test]"); | ||
}); | ||
}); |
Oops, something went wrong.