entry observations section unit test + e2e #493

Merged
joan merged 6 commits from 2685-create_test_e2e_entryObservation into dev 2021-01-04 08:26:51 +00:00
1 changed files with 29 additions and 0 deletions
Showing only changes of commit 5af51763d6 - Show all commits

View File

@ -0,0 +1,29 @@
const app = require('vn-loopback/server/server');
describe('EntryObservation', () => {
const entryId = 1;
it('should throw a user error if the observation type is duplicated.', async() => {
const observations = [
{
entryFk: entryId,
observationTypeFk: 1,
description: 'repeated description'
},
{
entryFk: entryId,
observationTypeFk: 1,
description: 'repeated description'
},
];
let error;
try {
await app.models.EntryObservation.create(observations);
} catch (e) {
error = e;
}
expect(error).toBeDefined();
});
});