Skip to content

Commit

Permalink
Update Tabs error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
domoscargin committed Oct 19, 2023
1 parent 2f2003a commit 0370716
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/govuk-frontend/src/govuk/components/tabs/tabs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export class Tabs extends GOVUKFrontendComponent {
if (!$tabs.length) {
throw new ElementError({
componentName: 'Tabs',
identifier: `a.govuk-tabs__tab`
identifier: 'Link (`<a class="govuk-tabs__tab">`)'
})
}

Expand All @@ -82,14 +82,14 @@ export class Tabs extends GOVUKFrontendComponent {
if (!$tabList) {
throw new ElementError({
componentName: 'Tabs',
identifier: `.govuk-tabs__list`
identifier: 'Tab list element (`.govuk-tabs__list`)'
})
}

if (!$tabListItems.length) {
throw new ElementError({
componentName: 'Tabs',
identifier: `.govuk-tabs__list-item`
identifier: 'Tab list item elements (`.govuk-tabs__list-item`)'
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ describe('/components/tabs', () => {
})
).rejects.toEqual({
name: 'ElementError',
message: 'Tabs: a.govuk-tabs__tab not found'
message: 'Tabs: Link (`<a class="govuk-tabs__tab">`) not found'
})
})

Expand All @@ -313,7 +313,7 @@ describe('/components/tabs', () => {
})
).rejects.toEqual({
name: 'ElementError',
message: 'Tabs: .govuk-tabs__list not found'
message: 'Tabs: Tab list element (`.govuk-tabs__list`) not found'
})
})

Expand All @@ -332,7 +332,8 @@ describe('/components/tabs', () => {
})
).rejects.toEqual({
name: 'ElementError',
message: 'Tabs: .govuk-tabs__list-item not found'
message:
'Tabs: Tab list item elements (`.govuk-tabs__list-item`) not found'
})
})
})
Expand Down

0 comments on commit 0370716

Please sign in to comment.