-
Notifications
You must be signed in to change notification settings - Fork 25
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 #1433 from RobAndrewHurst/workspace_rework
Test Workspace rework
- Loading branch information
Showing
9 changed files
with
222 additions
and
299 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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"infoj": [ | ||
{ | ||
"title": "qID", | ||
"field": "id", | ||
"inline": true | ||
}, | ||
{ | ||
"type": "key" | ||
}, | ||
{ | ||
"type": "pin", | ||
"label": "ST_PointOnSurface", | ||
"field": "pin", | ||
"fieldfx": "ARRAY[ST_X(ST_PointOnSurface(geom_3857)),ST_Y(ST_PointOnSurface(geom_3857))]" | ||
}, | ||
{ | ||
"title": "textarea", | ||
"field": "textarea", | ||
"edit": true | ||
}, | ||
{ | ||
"title": "char_field", | ||
"field": "char_field" | ||
}, | ||
{ | ||
"title": "minutes", | ||
"field": "integer_field", | ||
"inline": true | ||
} | ||
] | ||
} |
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,15 @@ | ||
{ | ||
"group": "layer", | ||
"format": "wkt", | ||
"dbs": "NEON", | ||
"tables": { | ||
"5": null, | ||
"6": "test.scratch" | ||
}, | ||
"table": "test.scratch", | ||
"srid": "3857", | ||
"geom": "geom_3857", | ||
"qID": "id", | ||
"toggleLocationViewEdits": true, | ||
"deleteLocation": true | ||
} |
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,23 @@ | ||
{ | ||
"style": { | ||
"default": { | ||
"strokeColor": "#333", | ||
"fillColor": "#fff9", | ||
"icon": { | ||
"type": "dot" | ||
} | ||
}, | ||
"highlight": { | ||
"scale": 1.3, | ||
"strokeColor": "#090" | ||
} | ||
}, | ||
"draw": { | ||
"circle_2pt": true, | ||
"circle": { | ||
"hidePanel": true | ||
}, | ||
"polygon": true, | ||
"point": true | ||
} | ||
} |
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,18 @@ | ||
{ | ||
"infoj": [ | ||
{ | ||
"title": "qID", | ||
"field": "_id", | ||
"inline": true | ||
}, | ||
{ | ||
"type": "key" | ||
}, | ||
{ | ||
"type": "pin", | ||
"label": "ST_PointOnSurface", | ||
"field": "pin", | ||
"fieldfx": "ARRAY[ST_X(ST_PointOnSurface(geom_3857)),ST_Y(ST_PointOnSurface(geom_3857))]" | ||
} | ||
] | ||
} |
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,27 @@ | ||
{ | ||
"display": true, | ||
"group": "layer", | ||
"format": "wkt", | ||
"dbs": "NEON", | ||
"table": "test.uk_geometries", | ||
"srid": "3857", | ||
"geom": "geom_3857", | ||
"qID": "_id", | ||
"toggleLocationViewEdits": true, | ||
"cluster": { | ||
"distance": 30 | ||
}, | ||
"hover": { | ||
"field": "_id", | ||
"display": "true" | ||
}, | ||
"draw": { | ||
"circle_2pt": true, | ||
"circle": { | ||
"hidePanel": true | ||
}, | ||
"polygon": true, | ||
"point": true | ||
}, | ||
"deleteLocation": true | ||
} |
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 |
---|---|---|
|
@@ -8,74 +8,77 @@ | |
* This function is used as an entry point for the changeEndTest | ||
* @function updateTest | ||
*/ | ||
export async function updateTest(mapview) { | ||
|
||
await codi.describe('User: update', async () => { | ||
|
||
/** | ||
* ### update endpoint should be able to process a body | ||
* The user update endpoint should be able to take a body as the request. | ||
* @function it | ||
*/ | ||
await codi.it('update endpoint should be able to process a body', async () => { | ||
|
||
let params = { | ||
url: '/test/api/user/update', | ||
body: JSON.stringify( | ||
{ | ||
email: '[email protected]', | ||
admin: false, | ||
approved: false, | ||
verified: false | ||
} | ||
) | ||
}; | ||
|
||
await mapp.utils.xhr(params); | ||
|
||
params = { | ||
url: '/test/api/user/update', | ||
body: JSON.stringify( | ||
{ | ||
email: '[email protected]', | ||
admin: true, | ||
approved: true, | ||
verified: false | ||
} | ||
) | ||
} | ||
|
||
await mapp.utils.xhr(params); | ||
|
||
const acl = await mapp.utils.xhr('/test/api/user/list'); | ||
const test_user = acl.filter(user => user.email === '[email protected]')[0]; | ||
|
||
await codi.assertEqual(test_user.email, '[email protected]', 'The users email address should be [email protected]') | ||
await codi.assertFalse(test_user.verified, 'The user should be not verified') | ||
await codi.assertTrue(test_user.admin, 'The user should an admin') | ||
await codi.assertTrue(test_user.approved, 'The user should be approved') | ||
export async function updateTest() { | ||
|
||
if (mapp.user) { | ||
await codi.describe('User: update', async () => { | ||
|
||
console.log(mapp); | ||
/** | ||
* ### update endpoint should be able to process a body | ||
* The user update endpoint should be able to take a body as the request. | ||
* @function it | ||
*/ | ||
await codi.it('update endpoint should be able to process a body', async () => { | ||
|
||
let params = { | ||
url: '/test/api/user/update', | ||
body: JSON.stringify( | ||
{ | ||
email: '[email protected]', | ||
admin: false, | ||
approved: false, | ||
verified: false | ||
} | ||
) | ||
}; | ||
|
||
await mapp.utils.xhr(params); | ||
|
||
params = { | ||
url: '/test/api/user/update', | ||
body: JSON.stringify( | ||
{ | ||
email: '[email protected]', | ||
admin: true, | ||
approved: true, | ||
verified: false | ||
} | ||
) | ||
} | ||
|
||
await mapp.utils.xhr(params); | ||
|
||
const acl = await mapp.utils.xhr('/test/api/user/list'); | ||
const test_user = acl.filter(user => user.email === '[email protected]')[0]; | ||
|
||
await codi.assertEqual(test_user.email, '[email protected]', 'The users email address should be [email protected]') | ||
await codi.assertFalse(test_user.verified, 'The user should be not verified') | ||
await codi.assertTrue(test_user.admin, 'The user should an admin') | ||
await codi.assertTrue(test_user.approved, 'The user should be approved') | ||
|
||
}); | ||
|
||
/** | ||
### update endpoint should be able to be just params | ||
* The user update endpoint should be able to take a body as the request. | ||
* @function it | ||
*/ | ||
await codi.it('update endpoint should be able to be just params', async () => { | ||
|
||
const url = `/test/api/user/[email protected]&field=admin&value=false` | ||
await mapp.utils.xhr(url); | ||
|
||
const acl = await mapp.utils.xhr('/test/api/user/list'); | ||
const test_user = acl.filter(user => user.email === '[email protected]')[0]; | ||
|
||
await codi.assertEqual(test_user.email, '[email protected]', 'The users email address should be [email protected]') | ||
await codi.assertFalse(test_user.verified, 'The user should be not verified') | ||
await codi.assertFalse(test_user.admin, 'The user should an admin') | ||
await codi.assertTrue(test_user.approved, 'The user should be approved') | ||
|
||
}); | ||
|
||
}); | ||
|
||
/** | ||
### update endpoint should be able to be just params | ||
* The user update endpoint should be able to take a body as the request. | ||
* @function it | ||
*/ | ||
await codi.it('update endpoint should be able to be just params', async () => { | ||
|
||
const url = `/test/api/user/[email protected]&field=admin&value=false` | ||
await mapp.utils.xhr(url); | ||
|
||
const acl = await mapp.utils.xhr('/test/api/user/list'); | ||
const test_user = acl.filter(user => user.email === '[email protected]')[0]; | ||
|
||
await codi.assertEqual(test_user.email, '[email protected]', 'The users email address should be [email protected]') | ||
await codi.assertFalse(test_user.verified, 'The user should be not verified') | ||
await codi.assertFalse(test_user.admin, 'The user should an admin') | ||
await codi.assertTrue(test_user.approved, 'The user should be approved') | ||
|
||
}); | ||
|
||
}); | ||
} | ||
} |
Oops, something went wrong.