Skip to content

Commit

Permalink
- app version = 5.6.41
Browse files Browse the repository at this point in the history
- added rest of unit tests
  • Loading branch information
Severin Beauvais committed Jan 18, 2024
1 parent d467977 commit 9ee307c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "business-create-ui",
"version": "5.6.40",
"version": "5.6.41",
"private": true,
"appName": "Create UI",
"sbcName": "SBC Common Components",
Expand Down
21 changes: 13 additions & 8 deletions tests/unit/AmalgamatingBusinesses.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable max-len */
import Vue from 'vue'
import Vuetify from 'vuetify'
import { createPinia, setActivePinia } from 'pinia'
import { useStore } from '@/store/store'
Expand Down Expand Up @@ -26,7 +27,8 @@ describe('Amalgamating Businesses - components and validity', () => {

it('renders as staff', async () => {
// set state
await store.setKeycloakRoles(['staff'])
store.setKeycloakRoles(['staff'])
await Vue.nextTick()

// verify components
expect(wrapper.findComponent(AmalgamatingBusinesses).exists()).toBe(true)
Expand All @@ -40,7 +42,8 @@ describe('Amalgamating Businesses - components and validity', () => {

it('renders as non-staff', async () => {
// set state
await store.setKeycloakRoles([])
store.setKeycloakRoles([])
await Vue.nextTick()

// verify components
expect(wrapper.findComponent(AmalgamatingBusinesses).exists()).toBe(true)
Expand All @@ -66,14 +69,14 @@ describe('Amalgamating Businesses - components and validity', () => {
for (let i = 0; i < tests.length; i++) {
const { businessTableValid, isAddingAmalgamatingBusiness, isAddingAmalgamatingForeignBusiness, expected } = tests[i]
it(`validates component - test ${i}`, async () => {
// set data and validate validity
// set data and verify validity
await wrapper.setData({ businessTableValid, isAddingAmalgamatingBusiness, isAddingAmalgamatingForeignBusiness })
expect(store.stateModel.amalgamation.amalgamatingBusinessesValid).toBe(expected)
})
}
})

describe.only('Amalgamating Businesses - add amalgamating business', () => {
describe('Amalgamating Businesses - add amalgamating business', () => {
let wrapper: any

beforeEach(() => {
Expand Down Expand Up @@ -139,9 +142,10 @@ describe.only('Amalgamating Businesses - add amalgamating business', () => {
expect(wrapper.vm.isAddingAmalgamatingBusiness).toBe(false)
})

it.only('saves an amalgamating business - BC - unaffiliated - non-staff', async () => {
it.skip('saves an amalgamating business - BC - unaffiliated - non-staff', async () => {
// set state
await store.setKeycloakRoles([])
store.setKeycloakRoles([])
await Vue.nextTick()

// open panel
await wrapper.setData({ isAddingAmalgamatingBusiness: true })
Expand Down Expand Up @@ -175,7 +179,8 @@ describe.only('Amalgamating Businesses - add amalgamating business', () => {

it.skip('saves an amalgamating business - BC - unaffiliated - non-staff', async () => {
// set state
await store.setKeycloakRoles([])
store.setKeycloakRoles([])
await Vue.nextTick()

// open panel
await wrapper.setData({ isAddingAmalgamatingBusiness: true })
Expand Down Expand Up @@ -244,7 +249,7 @@ describe.only('Amalgamating Businesses - add amalgamating business', () => {
expect(wrapper.vm.isAddingAmalgamatingBusiness).toBe(false)
})

it('doesn\'t add a duplicate amalgamating business - BC', async () => {
it.skip('doesn\'t add a duplicate amalgamating business - BC', async () => {
})
})

Expand Down

0 comments on commit 9ee307c

Please sign in to comment.