diff --git a/web/src/components/SftCard.test.ts b/web/src/components/SftCard.test.ts index c579d3f..6834987 100644 --- a/web/src/components/SftCard.test.ts +++ b/web/src/components/SftCard.test.ts @@ -52,7 +52,7 @@ describe('SftCard', () => { expect(w.find('[data-testid="quality-chip"]').classes()).toContain('quality-low') }) - it('quality chip has mid-quality class when score 0.4-0.7', () => { + it('quality chip has mid-quality class when score is 0.4 to <0.7', () => { const w = mount(SftCard, { props: { item: MID_QUALITY_ITEM } }) expect(w.find('[data-testid="quality-chip"]').classes()).toContain('quality-mid') }) @@ -89,4 +89,10 @@ describe('SftCard', () => { const w = mount(SftCard, { props: { item: LOW_QUALITY_ITEM, correcting: true } }) expect(w.find('[data-testid="correction-area"]').exists()).toBe(true) }) + + it('renders nothing for failure reason when null', () => { + const item = { ...LOW_QUALITY_ITEM, failure_reason: null } + const w = mount(SftCard, { props: { item } }) + expect(w.find('.failure-reason').exists()).toBe(false) + }) }) diff --git a/web/src/components/SftCard.vue b/web/src/components/SftCard.vue index 36cff08..f0ac2d1 100644 --- a/web/src/components/SftCard.vue +++ b/web/src/components/SftCard.vue @@ -17,7 +17,7 @@ -

{{ item.failure_reason }}

+

{{ item.failure_reason }}