From 252d565eab262d0659330d659a1ae9d5eaf7a619 Mon Sep 17 00:00:00 2001 From: Patrick Wang Date: Tue, 18 Jun 2024 08:17:18 -0700 Subject: [PATCH] set up current directors accordion --- src/components/bcros/AddressAccordion.vue | 24 +++++++++++- src/components/bcros/CurrentDirector.vue | 38 +++++++++++++++++++ src/components/bcros/Footer.vue | 6 +-- src/components/bcros/OfficeAddress.vue | 8 ++-- src/components/bcros/Section.vue | 2 +- src/pages/dashboard.vue | 2 +- .../bcros/BcrosAddressDisplay.spec.ts | 16 ++++---- tests/pages/dashboard.spec.ts | 3 +- tests/test-utils/mockedi18n.ts | 7 ++++ 9 files changed, 86 insertions(+), 20 deletions(-) create mode 100644 src/components/bcros/CurrentDirector.vue create mode 100644 tests/test-utils/mockedi18n.ts diff --git a/src/components/bcros/AddressAccordion.vue b/src/components/bcros/AddressAccordion.vue index 7b904c28..a7c0e30d 100644 --- a/src/components/bcros/AddressAccordion.vue +++ b/src/components/bcros/AddressAccordion.vue @@ -3,11 +3,31 @@ + - TBD + diff --git a/tests/components/bcros/BcrosAddressDisplay.spec.ts b/tests/components/bcros/BcrosAddressDisplay.spec.ts index 283f76ad..7b9535bd 100644 --- a/tests/components/bcros/BcrosAddressDisplay.spec.ts +++ b/tests/components/bcros/BcrosAddressDisplay.spec.ts @@ -40,10 +40,10 @@ describe('AddressDisplay tests', () => { expect(addressLines.at(1).text()).toBe(addressFilled.streetAdditional) expect(addressLines.at(2).text()).toBe('Vancouver BC V1L 4T7') expect(addressLines.at(3).text()).toBe(addressFilled.addressCountry) - // const locDesc = wrapper.find('[data-cy=location-description]') - // expect(locDesc.exists()).toBe(true) - // expect(locDesc.find('.title').text()).toBe('Location Description') - // expect(locDesc.find('[data-cy=content]').text()).toBe(addressFilled.locationDescription) + const locDesc = wrapper.find('[data-cy=location-description]') + expect(locDesc.exists()).toBe(true) + expect(locDesc.find('.title').text()).toBe('Location Description') + expect(locDesc.find('[data-cy=content]').text()).toBe(addressFilled.locationDescription) wrapper.unmount() }) @@ -71,10 +71,10 @@ describe('AddressDisplay tests', () => { const addressLines = wrapper.findAll('[data-cy=address-line]') expect(addressLines.length).toBe(1) expect(addressLines.at(0).text()).toBe(addressMissingParts.addressCountry) - // const locDesc = wrapper.find('[data-cy=location-description]') - // expect(locDesc.exists()).toBe(true) - // expect(locDesc.find('.title').text()).toBe('Location Description') - // expect(locDesc.find('[data-cy=content]').text()).toBe(addressMissingParts.locationDescription) + const locDesc = wrapper.find('[data-cy=location-description]') + expect(locDesc.exists()).toBe(true) + expect(locDesc.find('.title').text()).toBe('Location Description') + expect(locDesc.find('[data-cy=content]').text()).toBe(addressMissingParts.locationDescription) wrapper.unmount() }) diff --git a/tests/pages/dashboard.spec.ts b/tests/pages/dashboard.spec.ts index 9864c33b..6346c593 100644 --- a/tests/pages/dashboard.spec.ts +++ b/tests/pages/dashboard.spec.ts @@ -1,5 +1,6 @@ import { beforeEach, describe, expect, it } from 'vitest' import { flushPromises, mount, VueWrapper } from '@vue/test-utils' +import { mockedI18n } from '../test-utils/mockedi18n' import Dashboard from '../../src/pages/dashboard.vue' @@ -7,7 +8,7 @@ describe('dashboard page tests', () => { let wrapper: VueWrapper beforeEach(async () => { - wrapper = mount(Dashboard) + wrapper = mount(Dashboard, { global: { plugins: [mockedI18n] } }) // await api calls to resolve await flushPromises() }) diff --git a/tests/test-utils/mockedi18n.ts b/tests/test-utils/mockedi18n.ts new file mode 100644 index 00000000..1d109e45 --- /dev/null +++ b/tests/test-utils/mockedi18n.ts @@ -0,0 +1,7 @@ +import { createI18n } from 'vue-i18n' +import en from '~/lang/en.json' + +export const mockedI18n = createI18n({ + locale: 'en', + messages: en +})