fix isEditable spec
gitea/salix/pipeline/head This commit has test failures Details

This commit is contained in:
Bernat Exposito Domenech 2020-03-02 09:43:22 +01:00
parent bd46f6a302
commit 42b151c849
1 changed files with 3 additions and 3 deletions

View File

@ -31,21 +31,21 @@ describe('ticket isEditable()', () => {
expect(result).toEqual(true);
});
it('should not be able to edit a deleted or invoiced ticket if the role is salesAssistant', async() => {
it('should not be able to edit a deleted or invoiced ticket even for salesAssistant', async() => {
let ctx = {req: {accessToken: {userId: 21}}};
let result = await app.models.Ticket.isEditable(ctx, 19);
expect(result).toEqual(false);
});
it('should not be able to edit a deleted or invoiced ticket if the role is productionBoss', async() => {
it('should not be able to edit a deleted or invoiced ticket even for productionBoss', async() => {
let ctx = {req: {accessToken: {userId: 50}}};
let result = await app.models.Ticket.isEditable(ctx, 19);
expect(result).toEqual(false);
});
it('should not be able to edit a deleted or invoiced ticket if the role is salesPerson', async() => {
it('should not be able to edit a deleted or invoiced ticket even for salesPerson', async() => {
let ctx = {req: {accessToken: {userId: 18}}};
let result = await app.models.Ticket.isEditable(ctx, 19);