Unit tests for emits
Added max-len disable to test file for linting purposes.
This commit is contained in:
parent
bd4d514548
commit
811ac473f1
2 changed files with 29 additions and 0 deletions
|
|
@ -86,3 +86,31 @@ describe('Computed', () => {
|
|||
expect(modalHeader).toBe(mockDataStrings.cmsHeaderText);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Emits', () => {
|
||||
test('Should emit cancel-claim-confirmation when method called', async () => {
|
||||
// Arrange
|
||||
const { wrapper } = setupMocks();
|
||||
|
||||
// Act
|
||||
wrapper.vm.cancelClaimConfirmation();
|
||||
await wrapper.vm.$nextTick();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.emitted('cancel-claim-confirmation')).toBeTruthy();
|
||||
expect(wrapper.emitted('cancel-claim-confirmation').length).toBe(1);
|
||||
});
|
||||
|
||||
test('Should emit return-to-claim when method called', async () => {
|
||||
// Arrange
|
||||
const { wrapper } = setupMocks();
|
||||
|
||||
// Act
|
||||
wrapper.vm.returnToClaim();
|
||||
await wrapper.vm.$nextTick();
|
||||
|
||||
// Assert
|
||||
expect(wrapper.emitted('return-to-claim')).toBeTruthy();
|
||||
expect(wrapper.emitted('return-to-claim').length).toBe(1);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
/* eslint-disable max-len */
|
||||
// Components
|
||||
import coverageStatement from '@/layouts/coverage-statement/coverage-statement.vue';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue