Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

17701 Misc MHR Clean Up #1638

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ppr-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ import { computed, defineComponent, onBeforeMount, toRefs, reactive, watch } fro
import { useStore } from '@/store/store'
import { useRoute, useRouter } from 'vue-router'
import { storeToRefs } from 'pinia'

import { StatusCodes } from 'http-status-codes'
import { SessionStorageKeys } from 'sbc-common-components/src/util/constants'
import SbcHeader from 'sbc-common-components/src/components/SbcHeader.vue'
Expand Down
2 changes: 1 addition & 1 deletion ppr-ui/src/components/common/RegistrationsWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
class="py-1"
>
<b>{{ registrationLabel }} Registrations </b>
<span>({{ getRegTableTotalRowCount }})</span>
<span>({{ isPpr ? getRegTableTotalRowCount : myRegistrations.length }})</span>
</v-col>
<v-col>
<v-row
Expand Down
2 changes: 1 addition & 1 deletion ppr-ui/src/components/search/SearchBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@
</v-col>

<!-- Search Submit Buttons -->
<v-col class="pl-6 mt-1 search-btn-col">
<v-col class="pl-3 mt-1 search-btn-col">
<v-btn
id="search-btn"
class="search-bar-btn bg-primary mr-3"
Expand Down
1 change: 1 addition & 0 deletions ppr-ui/src/components/tables/SearchHistory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
<tr>
<th
v-for="header in headers"
class="pr-2 py-0"
:key="header.value"

Check warning on line 20 in ppr-ui/src/components/tables/SearchHistory.vue

View workflow job for this annotation

GitHub Actions / linting (20.5.1)

Attribute ":key" should go before "class"
:class="header.class"
>
{{ header.text }}
Expand Down
2 changes: 1 addition & 1 deletion ppr-ui/src/views/newRegistration/ReviewConfirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
class="pt-3 pb-3"
>
<v-col cols="auto">
<h1>{{ registrationTypeUI }}<span class="only-print"> - Draft</span></h1>
<h1>{{ registrationTypeUI }}</h1>
</v-col>
</v-row>
<Stepper
Expand Down
61 changes: 31 additions & 30 deletions ppr-ui/tests/unit/PartyReview.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import { shallowMount } from '@vue/test-utils'
import { mount } from '@vue/test-utils'
import { PartyReview } from '@/components/common'
import { createComponent } from './utils'
import { nextTick } from 'vue'
import { beforeEach } from 'vitest'

describe('PartyReview', () => {
let wrapper
const initializedParty = {
businessName: '',
address: {
Expand All @@ -19,50 +23,47 @@ describe('PartyReview', () => {
phoneNumber: '123-456-7890'
}

it('renders the component', () => {
const wrapper = shallowMount((PartyReview as any), {
propsData: {
baseParty: initializedParty
}
})
beforeEach(async () => {
wrapper = await createComponent(PartyReview, { baseParty: initializedParty })
await nextTick()
})

it('renders the component', async () => {
expect(wrapper.exists()).toBe(true)
})

it('renders the header slot content', () => {
it('renders the default header slot content', async () => {

const headerSlot = wrapper.find('.review-header')
expect(headerSlot.exists()).toBe(true)
expect(wrapper.text()).toContain('Submitting Party')
})

it('renders the custom header slot content', async () => {
const headerSlotContent = '<div class="review-header">Custom Header Slot</div>'
const wrapper = shallowMount((PartyReview as any), {
propsData: {
baseParty: initializedParty
},
slots: {
headerSlot: headerSlotContent
}
// For ease of testing the custom slots, we use mount instead of our custom createComponent function.
wrapper = mount(PartyReview,
{
props: { baseParty: initializedParty },
slots: {
headerSlot: headerSlotContent
}
})
await nextTick()

const headerSlot = wrapper.find('.review-header')
expect(headerSlot.exists()).toBe(true)
expect(headerSlot.html()).toContain(headerSlotContent)
expect(wrapper.text()).toContain('Custom Header Slot')
})

it('renders party information when data is available', () => {
const wrapper = shallowMount((PartyReview as any), {
propsData: {
baseParty: partyData
}
})
it('renders party information when data is available', async () => {
wrapper = await createComponent(PartyReview, { baseParty: partyData })

const partyInfo = wrapper.find('.party-info')
expect(partyInfo.exists()).toBe(true)
// Add more assertions to check if party information is rendered correctly.
})

it('does not render party information when no data is available', () => {
const wrapper = shallowMount((PartyReview as any), {
propsData: {
baseParty: initializedParty
}
})

it('does not render party information when no data is available', async () => {
const partyInfo = wrapper.find('.party-info')
expect(partyInfo.exists()).toBe(false)
})
Expand Down
Loading