Skip to content

Commit

Permalink
add some unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Qin <Arwen.Qin@gov.bc.ca>
  • Loading branch information
ArwenQin committed Dec 12, 2024
1 parent 6dba829 commit 8103748
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/unit/NoticeOfWithdrawal.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import { Certify } from '@/components/common'
import { DocumentDelivery } from '@bcrs-shared-components/document-delivery'
import mockRouter from './mockRouter'
import VueRouter from 'vue-router'
import PlanOfArrangement from '@/components/NoticeOfWithdrawal/PlanOfArrangement.vue'
import RecordToBeWithdrawn from '@/components/NoticeOfWithdrawal/RecordToBeWithdrawn.vue'
import ReferenceNumber from '@/components/NoticeOfWithdrawal/ReferenceNumber.vue'
import StaffPayment from '@/components/NoticeOfWithdrawal/StaffPayment.vue'
import StaffRoleErrorDialog from '@/components/NoticeOfWithdrawal/StaffRoleErrorDialog.vue'

// suppress various warnings:
// - "Unknown custom element <affix>" warnings
Expand Down Expand Up @@ -52,13 +54,15 @@ describe('Notice of Withdrawal view', () => {
expect(wrapper.findComponent(DocumentDelivery).exists()).toBe(true)
expect(wrapper.findComponent(PaymentErrorDialog).exists()).toBe(true)
expect(wrapper.findComponent(ResumeErrorDialog).exists()).toBe(true)
expect(wrapper.findComponent(StaffRoleErrorDialog).exists()).toBe(true)
expect(wrapper.findComponent(SaveErrorDialog).exists()).toBe(true)
expect(wrapper.findComponent(PlanOfArrangement).exists()).toBe(true)
expect(wrapper.findComponent(RecordToBeWithdrawn).exists()).toBe(true)
expect(wrapper.findComponent(ReferenceNumber).exists()).toBe(true)
expect(wrapper.findComponent(StaffPayment).exists()).toBe(true)

// Verify $route params and query
expect(wrapper.vm.filingToBeWithdrawn).toBe('12345')
//expect(wrapper.vm.filingToBeWithdrawn).toBe('12345')

Check failure on line 65 in tests/unit/NoticeOfWithdrawal.spec.ts

View workflow job for this annotation

GitHub Actions / business-filings-ui-ci / linting-npm (20.5.1)

Expected space or tab after '//' in comment
expect(wrapper.vm.filingId).toBe(0)

wrapper.destroy()
Expand Down Expand Up @@ -87,8 +91,7 @@ describe('Notice of Withdrawal view', () => {
expect(vm.filingData).not.toBeUndefined()
expect(vm.filingData).not.toBeNull()
expect(vm.filingData.length).toBe(1)
expect(vm.filingData[0].filingTypeCode).toBe('NOTICE_OF_WITHDRAWAL')
expect(vm.filingData[0].entityType).toBe('BC_COMPANY')
expect(vm.filingData[0].filingTypeCode).toBe('NOIWD')

wrapper.destroy()
})
Expand Down

0 comments on commit 8103748

Please # to comment.