Skip to content

Commit

Permalink
Fix Void Transport Permit Text and Badge (#1956)
Browse files Browse the repository at this point in the history
* Fix Void Transport Permit with active Exemption
  • Loading branch information
dimak1 authored Jun 28, 2024
1 parent 3f4ea99 commit f981599
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion ppr-ui/src/composables/exemption/useExemptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ import {
UnitNoteDocTypes,
UnitNoteStatusTypes
} from '@/enums'
import { useRouter } from 'vue-router'

export const useExemptions = () => {
const router = useRouter()
const { goToRoute } = useNavigation()
const { setMhrExemption, setMhrExemptionNote, setMhrExemptionValidation, setMhrExemptionValue } = useStore()
const {
Expand Down Expand Up @@ -60,7 +62,8 @@ export const useExemptions = () => {
const isExemptionWithActiveTransportPermit: ComputedRef<boolean> = computed((): boolean => {
return (
getMhrInformation.value.permitStatus === MhApiStatusTypes.ACTIVE &&
(isResExemption.value || isNonResExemption.value)
(isResExemption.value || isNonResExemption.value) &&
[RouteNames.EXEMPTION_DETAILS, RouteNames.EXEMPTION_REVIEW].includes(router.currentRoute.value.name as RouteNames)
)
})

Expand Down
4 changes: 2 additions & 2 deletions ppr-ui/tests/unit/ExemptionDetails.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import { axe } from 'vitest-axe'
import { TransportPermitDetails } from '@/components/mhrTransportPermit'
import { useStore } from '@/store/store'
import { mockedAddress } from './test-data'
import { UnitNoteDocTypes } from '@/enums'
import { RouteNames, UnitNoteDocTypes } from '@/enums'

const store = useStore()

describe('ExemptionDetails', () => {
let wrapper

beforeEach(async () => {
wrapper = await createComponent(ExemptionDetails as any, { showErrors: false })
wrapper = await createComponent(ExemptionDetails as any, { showErrors: false }, RouteNames.EXEMPTION_DETAILS)
await nextTick()
})

Expand Down
4 changes: 2 additions & 2 deletions ppr-ui/tests/unit/ExemptionReview.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { ConfirmCompletion } from '@/components/mhrTransfers'
import { StaffPayment } from '@/components/common'
import { axe } from 'vitest-axe'
import { useStore } from '@/store/store'
import { UnitNoteDocTypes } from '@/enums'
import { RouteNames, UnitNoteDocTypes } from '@/enums'
import { mockedAddress } from './test-data'
import { TransportPermitDetails } from '@/components/mhrTransportPermit'

Expand All @@ -32,7 +32,7 @@ describe('ExemptionReview', () => {
let wrapper

beforeEach(async () => {
wrapper = await createComponent(ExemptionReview, { showErrors: false }, null)
wrapper = await createComponent(ExemptionReview, { showErrors: false }, RouteNames.EXEMPTION_REVIEW)
setupMockStaffUser()
await nextTick()
})
Expand Down

0 comments on commit f981599

Please sign in to comment.