From ab6d60565f9e959d038cd7589dc93dbbb7f05dc0 Mon Sep 17 00:00:00 2001 From: Richard Doe Date: Thu, 10 Oct 2024 11:02:30 +0100 Subject: [PATCH] chore: title & heading for annotations tab (#2450) --- .../src/components/item/ItemMediaSidebar.vue | 14 +++++++++++--- packages/portal/src/i18n/lang/en.js | 1 + .../unit/components/item/ItemMediaSidebar.spec.js | 12 +++++++++++- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/packages/portal/src/components/item/ItemMediaSidebar.vue b/packages/portal/src/components/item/ItemMediaSidebar.vue index 1d811514d6..dfa1d96592 100644 --- a/packages/portal/src/components/item/ItemMediaSidebar.vue +++ b/packages/portal/src/components/item/ItemMediaSidebar.vue @@ -10,12 +10,20 @@ + +

{{ $t('media.sidebar.annotations') }}

shallowMount(ItemMediaSidebar, { mocks: { $t: (key) => key }, - stubs: ['b-link', 'b-tooltip'] + stubs: ['b-link', 'b-tooltip', 'MediaAnnotationList'] }); describe('components/item/ItemMediaSidebar', () => { @@ -23,6 +23,16 @@ describe('components/item/ItemMediaSidebar', () => { expect(sidebar.exists()).toBe(true); }); + describe('when there is an annotation URI', () => { + it('has a tab for annotations', () => { + const wrapper = factory({ annotationUri: 'https://example.com/iiif/123/annotations' }); + + const annotationsTab = wrapper.find('[data-qa="item media sidebar annotations"]'); + + expect(annotationsTab.exists()).toBe(true); + }); + }); + describe('when there is a manifest URI', () => { it('has a tab for links', () => { const wrapper = factory({ manifestUri: 'https://example.com/iiif/123/manifest' });