refactor: refs #7686 update editableStates tests to check for 'OK' and 'Bloqueado' states
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Javi Gallego 2025-01-28 09:16:19 +01:00
parent 0def25ad15
commit 08d2414363
1 changed files with 4 additions and 4 deletions

View File

@ -35,9 +35,9 @@ describe('ticket editableStates()', () => {
const editableStates = await models.State.editableStates(ctx, filter, options); const editableStates = await models.State.editableStates(ctx, filter, options);
const pickerDesignedState = editableStates.some(state => state.code == 'PICKER_DESIGNED'); const okState = editableStates.some(state => state.code == 'OK');
expect(pickerDesignedState).toBeTruthy(); expect(okState).toBeTruthy();
await tx.rollback(); await tx.rollback();
} catch (e) { } catch (e) {
@ -54,11 +54,11 @@ describe('ticket editableStates()', () => {
const employeeRole = 1; const employeeRole = 1;
const ctx = {req: {accessToken: {userId: employeeRole}}}; const ctx = {req: {accessToken: {userId: employeeRole}}};
const filter = {where: {name: {like: '%Previa OK%'}}}; const filter = {where: {name: {like: '%Bloqueado%'}}};
const [editableStates] = await models.State.editableStates(ctx, filter, options); const [editableStates] = await models.State.editableStates(ctx, filter, options);
expect(editableStates.name).toBe('Previa OK'); expect(editableStates.name).toBe('Bloqueado');
await tx.rollback(); await tx.rollback();
} catch (e) { } catch (e) {