Created back test field for entryObservation
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Jorge Padawan 2020-12-28 12:55:28 +01:00
parent c192a0e125
commit 5af51763d6
1 changed files with 29 additions and 0 deletions

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();
});
});