Skip to content

Commit

Permalink
"Add Filters" -> "Add filters" in AddFiltersMenu (#5425)
Browse files Browse the repository at this point in the history
* Initial commit

* Fix tests

* Add changeset

* Update changeset

Co-authored-by: Doug MacKenzie <[email protected]>

---------

Co-authored-by: Christian Moore <[email protected]>
Co-authored-by: Doug MacKenzie <[email protected]>
  • Loading branch information
3 people authored Dec 23, 2024
1 parent 16e7792 commit 3c296b1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/fluffy-candles-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@kaizen/components': patch
---

FilterBar: 'Add Filters' button label changed to 'Add filters' to follow guidelines
20 changes: 10 additions & 10 deletions packages/components/src/Filter/FilterBar/FilterBar.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ describe('<FilterBar />', () => {

expect(queryByText('Topping')).not.toBeInTheDocument()

const addFiltersButton = getByRole('button', { name: 'Add Filters' })
const addFiltersButton = getByRole('button', { name: 'Add filters' })
await user.click(addFiltersButton)

const list = getByRole('list')
Expand Down Expand Up @@ -228,7 +228,7 @@ describe('<FilterBar />', () => {
)
await waitForI18nContent()

const addFiltersButton = getByRole('button', { name: 'Add Filters' })
const addFiltersButton = getByRole('button', { name: 'Add filters' })
await user.click(addFiltersButton)

const list = getByRole('list')
Expand All @@ -255,7 +255,7 @@ describe('<FilterBar />', () => {
expect(filterButton).not.toBeInTheDocument()
})

const addFiltersButton = getByRole('button', { name: 'Add Filters' })
const addFiltersButton = getByRole('button', { name: 'Add filters' })
await user.click(addFiltersButton)

const list = getByRole('list')
Expand All @@ -282,7 +282,7 @@ describe('<FilterBar />', () => {
)
await waitForI18nContent()

const addFiltersButton = getByRole('button', { name: 'Add Filters' })
const addFiltersButton = getByRole('button', { name: 'Add filters' })
await user.click(addFiltersButton)

const menuOptionIceLevel = getByRole('button', { name: 'Ice Level' })
Expand Down Expand Up @@ -314,7 +314,7 @@ describe('<FilterBar />', () => {
)
await waitForI18nContent()

const addFiltersButton = getByRole('button', { name: 'Add Filters' })
const addFiltersButton = getByRole('button', { name: 'Add filters' })
await user.click(addFiltersButton)

const menuOptionIceLevel = getByRole('button', { name: 'Ice Level' })
Expand All @@ -327,7 +327,7 @@ describe('<FilterBar />', () => {
const { getByRole } = render(<FilterBarWrapper<ValuesRemovable> filters={filtersRemovable} />)
await waitForI18nContent()

const addFiltersButton = getByRole('button', { name: 'Add Filters' })
const addFiltersButton = getByRole('button', { name: 'Add filters' })
await user.click(addFiltersButton)

const menuOptionOthers = getByRole('button', { name: 'Others' })
Expand All @@ -353,7 +353,7 @@ describe('<FilterBar />', () => {
expect(filterButton).not.toBeInTheDocument()
})

expect(getByRole('button', { name: 'Add Filters' })).toHaveFocus()
expect(getByRole('button', { name: 'Add filters' })).toHaveFocus()
})
})

Expand All @@ -363,7 +363,7 @@ describe('<FilterBar />', () => {
const { queryByRole, getByRole } = render(<FilterBarWrapper filters={filtersDependent} />)
await waitForI18nContent()
expect(queryByRole('button', { name: 'Topping' })).not.toBeInTheDocument()
expect(getByRole('button', { name: 'Add Filters' })).toBeDisabled()
expect(getByRole('button', { name: 'Add filters' })).toBeDisabled()
})

it('clears the value if the filter is not usable', async () => {
Expand Down Expand Up @@ -426,7 +426,7 @@ describe('<FilterBar />', () => {
)
await waitForI18nContent()

const addFiltersButton = getByRole('button', { name: 'Add Filters' })
const addFiltersButton = getByRole('button', { name: 'Add filters' })
expect(addFiltersButton).toBeDisabled()

const flavourButton = getByRole('button', { name: 'Flavour' })
Expand Down Expand Up @@ -612,7 +612,7 @@ describe('<FilterBar />', () => {
expect(queryByRole('button', { name: 'Sugar' })).not.toBeInTheDocument()
expect(queryByRole('button', { name: 'Ice' })).not.toBeInTheDocument()

const addFiltersButton = getByRole('button', { name: 'Add Filters' })
const addFiltersButton = getByRole('button', { name: 'Add filters' })
expect(addFiltersButton).toBeDisabled()

await user.click(coffeeButton)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ describe('<AddFiltersMenu />', () => {
render(<AddFiltersMenuWrapper filters={filters} />)

await waitFor(() => {
expect(screen.getByRole('button', { name: 'Add Filters' })).toBeVisible()
expect(screen.getByRole('button', { name: 'Add filters' })).toBeVisible()
})
const addFiltersButton = screen.getByRole('button', { name: 'Add Filters' })
const addFiltersButton = screen.getByRole('button', { name: 'Add filters' })
await user.click(addFiltersButton)

await waitFor(() => {
Expand All @@ -74,7 +74,7 @@ describe('<AddFiltersMenu />', () => {

await waitFor(() => {
const addFiltersButton = screen.getByRole('button', {
name: 'Add Filters',
name: 'Add filters',
})
expect(addFiltersButton).toBeDisabled()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const AddFiltersMenu = (): JSX.Element => {

const menuButtonLabel = formatMessage({
id: 'filterBar.addFiltersMenu.buttonLabel',
defaultMessage: 'Add Filters',
defaultMessage: 'Add filters',
description: 'Menu button label to show additional available filter options',
})

Expand Down

0 comments on commit 3c296b1

Please sign in to comment.