diff options
Diffstat (limited to 'spec/frontend/admin/abuse_report/components/report_header_spec.js')
-rw-r--r-- | spec/frontend/admin/abuse_report/components/report_header_spec.js | 55 |
1 files changed, 24 insertions, 31 deletions
diff --git a/spec/frontend/admin/abuse_report/components/report_header_spec.js b/spec/frontend/admin/abuse_report/components/report_header_spec.js index f22f3af091f..6ec380f0387 100644 --- a/spec/frontend/admin/abuse_report/components/report_header_spec.js +++ b/spec/frontend/admin/abuse_report/components/report_header_spec.js @@ -54,37 +54,30 @@ describe('ReportHeader', () => { }); describe.each` - status | text | variant | className | badgeIcon - ${STATUS_OPEN} | ${REPORT_HEADER_I18N[STATUS_OPEN]} | ${'success'} | ${'issuable-status-badge-open'} | ${'issues'} - ${STATUS_CLOSED} | ${REPORT_HEADER_I18N[STATUS_CLOSED]} | ${'info'} | ${'issuable-status-badge-closed'} | ${'issue-closed'} - `( - 'rendering the report $status status badge', - ({ status, text, variant, className, badgeIcon }) => { - beforeEach(() => { - createComponent({ report: { ...report, status } }); - }); - - it(`indicates the ${status} status`, () => { - expect(findBadge().text()).toBe(text); - }); - - it(`with the ${variant} variant`, () => { - expect(findBadge().props('variant')).toBe(variant); - }); - - it(`with the text '${text}' as 'aria-label'`, () => { - expect(findBadge().attributes('aria-label')).toBe(text); - }); - - it(`contains the ${className} class`, () => { - expect(findBadge().element.classList).toContain(className); - }); - - it(`has an icon with the ${badgeIcon} name`, () => { - expect(findIcon().props('name')).toBe(badgeIcon); - }); - }, - ); + status | text | variant | badgeIcon + ${STATUS_OPEN} | ${REPORT_HEADER_I18N[STATUS_OPEN]} | ${'success'} | ${'issues'} + ${STATUS_CLOSED} | ${REPORT_HEADER_I18N[STATUS_CLOSED]} | ${'info'} | ${'issue-closed'} + `('rendering the report $status status badge', ({ status, text, variant, badgeIcon }) => { + beforeEach(() => { + createComponent({ report: { ...report, status } }); + }); + + it(`indicates the ${status} status`, () => { + expect(findBadge().text()).toBe(text); + }); + + it(`with the ${variant} variant`, () => { + expect(findBadge().props('variant')).toBe(variant); + }); + + it(`with the text '${text}' as 'aria-label'`, () => { + expect(findBadge().attributes('aria-label')).toBe(text); + }); + + it(`has an icon with the ${badgeIcon} name`, () => { + expect(findIcon().props('name')).toBe(badgeIcon); + }); + }); it('renders the actions', () => { const actionsComponent = findActions(); |