-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
label assignment e2e mostly complete
- Loading branch information
Amund Myrbostad
committed
Sep 27, 2024
1 parent
ac8a9aa
commit d4ef702
Showing
5 changed files
with
66 additions
and
13 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
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
// This file is generated, see "scripts" directory | ||
import { default as dialogDetails } from './dialogDetails.js'; | ||
import { default as dialogSearch } from './dialogSearch.js'; | ||
import { default as dialogSystemLabel } from './dialogSystemLabel.js'; | ||
import { default as dialogSystemLabelLog } from './dialogSystemLabelLog.js'; | ||
import { default as parties } from './parties.js'; | ||
|
||
export default function() { | ||
dialogDetails(); | ||
dialogSearch(); | ||
dialogSystemLabel(); | ||
dialogSystemLabelLog(); | ||
parties(); | ||
} |
This file was deleted.
Oops, something went wrong.
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,62 @@ | ||
import { | ||
describe, expect, expectStatusFor, getEU, postEU, postSO, putSO, purgeSO, uuidv7 | ||
} from '../../common/testimports.js' | ||
|
||
import {default as dialogToInsert} from '../serviceowner/testdata/01-create-dialog.js'; | ||
import {getDefaultEnduserOrgNo, getDefaultEnduserSsn} from '../../common/token.js'; | ||
|
||
export default function () { | ||
//Lag 1 dialog, gjør forandriger på den, sjekk om det er log | ||
let dialogId; | ||
let dialog; | ||
describe('Arrange: Create a dialog to test against', () => { | ||
let d = dialogToInsert(); | ||
let r = postSO("dialogs", d); | ||
expectStatusFor(r).to.equal(201); | ||
dialogId = r.json(); | ||
dialog = d; | ||
}); | ||
|
||
describe('Update label as enduser', () => { | ||
let body = { | ||
'label': 'systemlabel:Bin' | ||
} | ||
let response = postEU('dialogs/' + dialogId + '/labels', body); | ||
expectStatusFor(response).to.equal(204); | ||
response = getEU('dialogs/' + dialogId + '/labellog'); | ||
expectStatusFor(response).to.equal(200); | ||
expect(response, 'response').to.have.validJsonBody(); | ||
console.log(response.json()); | ||
expect(response.json(), 'response body').to.have.lengthOf(1); | ||
}); | ||
|
||
describe('Changing labels trigger 2 logs', () => { | ||
|
||
let body = { | ||
'label': 'systemlabel:Archive' | ||
} | ||
let response = postEU('dialogs/' + dialogId + '/labels', body); | ||
expectStatusFor(response).to.equal(204); | ||
response = getEU('dialogs/' + dialogId + '/labellog'); | ||
expectStatusFor(response).to.equal(200); | ||
expect(response, 'response').to.have.validJsonBody(); | ||
console.log(response.json()); | ||
expect(response.json(), 'response body').to.have.lengthOf(3); | ||
}) | ||
|
||
describe('Dialog update set system label to default', () => { | ||
dialog.progress ="60"; | ||
let response = putSO('dialogs/' + dialogId,dialog); | ||
expectStatusFor(response).to.equal(204); | ||
response = getEU('dialogs/' + dialogId + '/labellog'); | ||
expectStatusFor(response).to.equal(200); | ||
expect(response, 'response').to.have.validJsonBody(); | ||
console.log(response.json()); | ||
expect(response.json(), 'response body').to.have.lengthOf(4); | ||
}) | ||
|
||
describe('Cleanup', () => { | ||
let response = purgeSO("dialogs/" + dialogId); | ||
expectStatusFor(response).to.equal(204); | ||
}) | ||
} |