Skip to content

Commit

Permalink
STSMACOM-796 Fix failing ControlledVocabErrors tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BogdanDenis committed Jan 9, 2024
1 parent ae64793 commit b7d0bde
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 20 deletions.
22 changes: 21 additions & 1 deletion lib/ControlledVocab/tests/ControlledVocabErrors-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,27 @@ describe('ControlledVocabErrors', () => {

function mount() {
// eslint-disable-next-line no-undef
beforeEach(() => mountComponent(true, server));
beforeEach(function () {
mountComponent(true, this.server);
this.server.post('location-units/institutions', {
'errors': [{
'message': 'Cannot create entity; name is not unique',
'code': 'name.duplicate',
'parameters': [{
'key': 'fieldLabel',
'value': 'name'
}]
},
{
'message': 'test',
'code': '-1',
'parameters': [{
'key': 'test',
'value': 'test'
}]
}]
}, 422);
});
beforeEach(async () => {
await cv.newButton().click();
await cv.fillInputField('test');
Expand Down
19 changes: 0 additions & 19 deletions tests/network/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,6 @@ export default function config() {

this.get('/note-types');

this.post('location-units/institutions', {
'errors': [{
'message': 'Cannot create entity; name is not unique',
'code': 'name.duplicate',
'parameters': [{
'key': 'fieldLabel',
'value': 'name'
}]
},
{
'message': 'test',
'code': '-1',
'parameters': [{
'key': 'test',
'value': 'test'
}]
}]
}, 422);

this.get('/note-links/domain/dummy/type/:type/id/:id', ({ notes }, { params, queryParams }) => {
return notes.where((note) => {
const conditions = [];
Expand Down

0 comments on commit b7d0bde

Please sign in to comment.