Skip to content

Commit be81483

Browse files
committed
additional tests per #1618 (comment)
1 parent 41220e7 commit be81483

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

test/integration/api/entities.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2168,17 +2168,28 @@ describe('Entities API', () => {
21682168
it('should reject if the entity has not been deleted', testEntities(async (service) => {
21692169
const asAlice = await service.login('alice');
21702170

2171-
await asAlice.post('/v1/projects/1/datasets/people/entities/12345678-1234-4123-8234-123456789abc/restore')
2171+
await asAlice.post('/v1/projects/1/datasets/people/entities/uuid:12345678-1234-4123-8234-123456789abc/restore')
21722172
.expect(404);
21732173
}));
21742174

21752175
it('should reject if the entity does not exist', testEntities(async (service) => {
21762176
const asAlice = await service.login('alice');
21772177

2178-
await asAlice.post('/v1/projects/1/datasets/people/entities/00000000-0000-0000-0000-000000000000/restore')
2178+
await asAlice.post('/v1/projects/1/datasets/people/entities/uuid:00000000-0000-4000-8000-000000000000/restore')
21792179
.expect(404);
21802180
}));
21812181

2182+
it('should reject if the entity uuid is not valid', testEntities(async (service) => {
2183+
const asAlice = await service.login('alice');
2184+
2185+
await asAlice.post('/v1/projects/1/datasets/people/entities/uuid:not-a-uuid/restore')
2186+
.expect(400)
2187+
.then(({ body }) => {
2188+
body.code.should.equal(400.11);
2189+
body.message.should.equal('Invalid input data type: expected (uuid) to be (valid version 4 UUID)');
2190+
});
2191+
}));
2192+
21822193
it('should reject if the user cannot restore', testEntities(async (service) => {
21832194
const asChelsea = await service.login('chelsea');
21842195

0 commit comments

Comments
 (0)