Short variant for filter texts (#943)
* - added a short variant for filter labels in the filter bar * - fixed tests - moved colon to shortoperand * - fixed formatting
This commit is contained in:
@ -55,8 +55,10 @@ export const FilterByName: Story = {
|
||||
expect(await canvas.findByText('Aircall')).toBeInTheDocument();
|
||||
await expect(canvas.queryAllByText('Qonto')).toStrictEqual([]);
|
||||
|
||||
expect(await canvas.findByText('Name:')).toBeInTheDocument();
|
||||
expect(await canvas.findByText('Contains Air')).toBeInTheDocument();
|
||||
const accountOwnerFilter = canvas.getAllByText('Name').find((item) => {
|
||||
return item.parentElement?.textContent?.includes('Name: Air');
|
||||
});
|
||||
expect(accountOwnerFilter).toBeInTheDocument();
|
||||
},
|
||||
};
|
||||
|
||||
@ -100,7 +102,13 @@ export const FilterByAccountOwner: Story = {
|
||||
// expect(await canvas.findByText('Airbnb')).toBeInTheDocument();
|
||||
// await expect(canvas.queryAllByText('Qonto')).toStrictEqual([]);
|
||||
|
||||
expect(await canvas.findByText('Account owner:')).toBeInTheDocument();
|
||||
expect(await canvas.findByText('Is Charles Test')).toBeInTheDocument();
|
||||
const accountOwnerFilter = canvas
|
||||
.getAllByText('Account owner')
|
||||
.find((item) => {
|
||||
return item.parentElement?.textContent?.includes(
|
||||
'Account owner: Charles Test',
|
||||
);
|
||||
});
|
||||
expect(accountOwnerFilter).toBeInTheDocument();
|
||||
},
|
||||
};
|
||||
|
||||
@ -54,8 +54,10 @@ export const Email: Story = {
|
||||
expect(await canvas.findByText('Alexandre Prot')).toBeInTheDocument();
|
||||
await expect(canvas.queryAllByText('John Doe')).toStrictEqual([]);
|
||||
|
||||
expect(await canvas.findByText('Email:')).toBeInTheDocument();
|
||||
expect(await canvas.findByText('Contains al')).toBeInTheDocument();
|
||||
const emailFilter = canvas.getAllByText('Email').find((item) => {
|
||||
return item.parentElement?.textContent?.includes('Email: al');
|
||||
});
|
||||
expect(emailFilter).toBeInTheDocument();
|
||||
},
|
||||
};
|
||||
|
||||
@ -99,7 +101,9 @@ export const CompanyName: Story = {
|
||||
// expect(await canvas.findByText('Alexandre Prot')).toBeInTheDocument();
|
||||
// await expect(canvas.queryAllByText('John Doe')).toStrictEqual([]);
|
||||
|
||||
expect(await canvas.findByText('Company:')).toBeInTheDocument();
|
||||
expect(await canvas.findByText('Is Qonto')).toBeInTheDocument();
|
||||
const companyFilter = canvas.getAllByText('Company').find((item) => {
|
||||
return item.parentElement?.textContent?.includes('Company: Qonto');
|
||||
});
|
||||
expect(companyFilter).toBeInTheDocument();
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user