forked from GEOLYTIX/xyz
-
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.
- Loading branch information
1 parent
06d7b8a
commit 391d752
Showing
11 changed files
with
87 additions
and
53 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
File renamed without changes.
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 @@ | ||
{} |
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,29 @@ | ||
export function getLayerTest() { | ||
codi.describe('Workspace tests: Get Layer Test', async () => { | ||
|
||
await codi.it('Workspace: Getting template_test Layer', async () => { | ||
let layer = await mapp.utils.xhr(`/test/api/workspace/layer?layer=template_test`); | ||
codi.assertEqual(layer.key, 'template_test', 'Ensure that we get the template_test layer from the API') | ||
codi.assertTrue(!!layer.table, 'Ensure that the layer has a table'); | ||
codi.assertTrue(!!layer.geom, 'Ensure that the layer has a geom'); | ||
codi.assertTrue(!!layer.group, 'Ensure that the layer has a group'); | ||
codi.assertEqual(layer.infoj.length, 7, 'The infoj should always have 7 infoj entries') | ||
codi.assertTrue(!!layer.style, 'The layer needs to have a style object from another template') | ||
|
||
layer = await mapp.utils.xhr(`/test/api/workspace/layer?layer=template_test`); | ||
codi.assertEqual(layer.infoj.length, 7, 'The infoj should always have 7 infoj entries') | ||
codi.assertTrue(!!layer.style, 'The layer needs to have a style object from another template') | ||
codi.assertTrue(!!layer.err, 'The layer should have a error array') | ||
codi.assertEqual(layer.err.length, 1, 'There should be on failure on the layer'); | ||
}); | ||
|
||
await codi.it('Workspace: Getting template_test_vanilla Layer', async () => { | ||
const layer = await mapp.utils.xhr(`/test/api/workspace/layer?layer=template_test_vanilla`); | ||
codi.assertEqual(layer.key, 'template_test_vanilla', 'Ensure that we get the template_test_vanilla layer from the API') | ||
codi.assertEqual(layer.infoj.length, 6, 'The infoj should always have 6 infoj entries') | ||
codi.assertTrue(!!layer.style, 'The layer needs to have a style object from another template') | ||
}); | ||
}); | ||
} | ||
|
||
|
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,26 @@ | ||
|
||
import { hasRoles } from '../../utils/roles.js' | ||
|
||
export function getLocaleTest() { | ||
codi.describe('Workspace: Get Locale Test', async () => { | ||
|
||
await codi.it('Workspace: Getting Locales', async () => { | ||
const locales = await mapp.utils.xhr(`/test/api/workspace/locales`); | ||
codi.assertEqual(locales[0].key, 'locale', 'Ensure that we are getting a locale back from the API') | ||
}); | ||
|
||
await codi.it('Workspace: Getting a Locale', async () => { | ||
const locale = await mapp.utils.xhr(`/test/api/workspace/locale?locale=locale`); | ||
codi.assertTrue(!!locale.key, 'The locale should have a key property'); | ||
codi.assertTrue(!!locale.layers, 'The locale should have layers'); | ||
codi.assertTrue(!!locale.name, 'The locale should have a name'); | ||
codi.assertTrue(!!locale.plugins, 'The locale should have plugins'); | ||
codi.assertTrue(!!locale.syncPlugins, 'The locale should have syncPlugins'); | ||
}); | ||
|
||
await codi.it('Workspace: Checking locale for roles', async () => { | ||
const locale = await mapp.utils.xhr(`/test/api/workspace/locale?locale=locale&layers=true`); | ||
codi.assertFalse(hasRoles(locale), 'The locale object should have no roles object returned') | ||
}); | ||
}) | ||
} |
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,11 @@ | ||
export function getTemplateTest() { | ||
codi.describe('Workspace: Get Template Test', async () => { | ||
codi.it('Layer template test', async () => { | ||
await mapp.utils.xhr(`/test/api/workspace/test`); | ||
|
||
const res = await mapp.utils.xhr('/test/api/query?layer=template_test&template=layer_data_array') | ||
|
||
codi.assertEqual(res, [1, 2, 5, 3, 4], 'We expect the query to be able to return from the workspace before the layer has been merged') | ||
}) | ||
}); | ||
} |
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