diff --git a/ppr-ui/src/views/mhrInformation/MhrHistory.vue b/ppr-ui/src/views/mhrInformation/MhrHistory.vue index 7b43948c0..9686301f7 100644 --- a/ppr-ui/src/views/mhrInformation/MhrHistory.vue +++ b/ppr-ui/src/views/mhrInformation/MhrHistory.vue @@ -96,7 +96,7 @@ onMounted(async (): Promise => { // Fetch Manufactured Home History loading.value = true - mhrHistory.value = await getMhrHistory(getMhrInformation.value?.mhrNumber) + mhrHistory.value = await getMhrHistory(getMhrInformation.value?.mhrNumber) || {} loading.value = false }) diff --git a/ppr-ui/tests/unit/MhrHistory.spec.ts b/ppr-ui/tests/unit/MhrHistory.spec.ts index 388a4c7b0..a9f5945f7 100644 --- a/ppr-ui/tests/unit/MhrHistory.spec.ts +++ b/ppr-ui/tests/unit/MhrHistory.spec.ts @@ -2,28 +2,15 @@ import { MhrHistory } from '@/views' import { nextTick } from 'vue' import { createComponent, setupMockStaffUser } from './utils' import { defaultFlagSet, pacificDate } from '@/utils' -import axios from 'axios' -import MockAdapter from 'axios-mock-adapter' import { expect } from 'vitest' import { RouteNames } from '@/enums' describe('HistoricalManufacturedHomeInfo', () => { let wrapper: any - let mock: MockAdapter defaultFlagSet['mhr-history-enabled'] = true beforeEach(async () => { - mock = new MockAdapter(axios) - mock.onGet(/\/registrations\/history\/\d+/).reply(200, { - mhrNumber: '123456', - descriptions: [], - locations: [], - owners: [], - registrations: [], - statusType: 'ACTIVE' - }) - setupMockStaffUser() wrapper = await createComponent(MhrHistory, { appReady: true @@ -31,10 +18,6 @@ describe('HistoricalManufacturedHomeInfo', () => { await nextTick() }) - afterEach(() => { - mock.restore() - }) - it('renders correctly when data is loaded', async () => { expect(wrapper.exists()).toBe(true) expect(wrapper.find('h1').text()).toBe('Historical Manufactured Home Information')