Refactor/new menu item (#1448)
* wip * finished * Added disabled * Fixed disabled * Finished cleaning * Minor fixes from merge * Added docs * Added PascalCase * Fix from review * Fixes from merge * Fix lint * Fixed storybook tests
This commit is contained in:
@ -35,11 +35,7 @@ export const FilterByName: Story = {
|
||||
const filterButton = await canvas.findByText('Filter');
|
||||
await userEvent.click(filterButton);
|
||||
|
||||
const nameFilterButton = (
|
||||
await canvas.findAllByTestId('dropdown-menu-item')
|
||||
).find((item) => {
|
||||
return item.textContent === 'Name';
|
||||
});
|
||||
const nameFilterButton = await canvas.findByTestId('select-filter-0');
|
||||
|
||||
assert(nameFilterButton);
|
||||
|
||||
@ -70,11 +66,9 @@ export const FilterByAccountOwner: Story = {
|
||||
const filterButton = await canvas.findByText('Filter');
|
||||
await userEvent.click(filterButton);
|
||||
|
||||
const accountOwnerFilterButton = (
|
||||
await canvas.findAllByTestId('dropdown-menu-item')
|
||||
).find((item) => {
|
||||
return item.textContent === 'Account owner';
|
||||
});
|
||||
const accountOwnerFilterButton = await canvas.findByTestId(
|
||||
'select-filter-5',
|
||||
);
|
||||
|
||||
assert(accountOwnerFilterButton);
|
||||
|
||||
@ -89,11 +83,11 @@ export const FilterByAccountOwner: Story = {
|
||||
|
||||
await sleep(1000);
|
||||
|
||||
const charlesChip = (
|
||||
await canvas.findAllByTestId('dropdown-menu-item')
|
||||
).find((item) => {
|
||||
return item.textContent?.includes('Charles Test');
|
||||
});
|
||||
const charlesChip = (await canvas.findAllByTestId('menu-item')).find(
|
||||
(item) => {
|
||||
return item.textContent?.includes('Charles Test');
|
||||
},
|
||||
);
|
||||
|
||||
assert(charlesChip);
|
||||
|
||||
|
||||
@ -33,9 +33,8 @@ export const SortByName: Story = {
|
||||
const sortButton = await canvas.findByText('Sort');
|
||||
await userEvent.click(sortButton);
|
||||
|
||||
const nameSortButton = canvas.getByText('Name', {
|
||||
selector: 'li > div > div',
|
||||
});
|
||||
const nameSortButton = await canvas.findByTestId('select-sort-0');
|
||||
|
||||
await userEvent.click(nameSortButton);
|
||||
|
||||
expect(await canvas.getByTestId('remove-icon-name')).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user