forked from bcgov/sbc-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
21535 - Disable form when processing EFT refund (bcgov#2938)
- Loading branch information
Showing
4 changed files
with
53 additions
and
51 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 |
---|---|---|
|
@@ -43,20 +43,22 @@ describe('ShortNameRefundView.vue', () => { | |
expect(wrapper.find('[data-test="staffComment"]').exists()).toBe(true) | ||
}) | ||
|
||
it('clears the form when the cancel button is clicked', async () => { | ||
await wrapper.setData({ | ||
refundAmount: 100.00, | ||
casSupplierNum: 'CAS-123', | ||
email: '[email protected]', | ||
staffComment: 'Test comment' | ||
it('return to previous page when cancel button is clicked', async () => { | ||
const router = new VueRouter() | ||
wrapper = mount(ShortNameRefundView, { | ||
propsData: { | ||
shortNameDetails: { shortName: 'TEST', creditsRemaining: '500.0' }, | ||
unsettledAmount: '100.0' | ||
}, | ||
localVue, | ||
vuetify, | ||
router | ||
}) | ||
const push = sinon.stub(wrapper.vm.$router, 'push') | ||
|
||
const cancelButton = wrapper.find('[data-test="btn-edit-routing-cancel"]') | ||
await cancelButton.trigger('click') | ||
await wrapper.find('[data-test="btn-edit-cancel"]').trigger('click') | ||
|
||
expect(wrapper.vm.$data.refundAmount).toBe(undefined) | ||
expect(wrapper.vm.$data.casSupplierNum).toBe('') | ||
expect(wrapper.vm.$data.email).toBe('') | ||
expect(wrapper.vm.$data.staffComment).toBe('') | ||
expect(push.calledWith({ name: 'shortnamedetails' })).toBe(true) | ||
push.restore() | ||
}) | ||
}) |