(app-desk) improve sorting teams test e2e

This tests was becoming very flaky because we create
teams in parallel with the other tests.
We use another approch, we checks the aria are
changing according to the sort, we check
as well the api request and that the response
is ok.
This commit is contained in:
Anthony LC
2024-03-27 11:37:11 +01:00
committed by Anthony LC
parent 224025c3fb
commit 91f755306b
2 changed files with 35 additions and 22 deletions

View File

@@ -13,6 +13,8 @@ export const PanelActions = () => {
const { changeOrdering, ordering } = useTeamStore();
const { colorsTokens } = useCunninghamTheme();
const isSortAsc = ordering === TeamsOrdering.BY_CREATED_ON;
return (
<Box
$direction="row"
@@ -28,14 +30,14 @@ export const PanelActions = () => {
`}
>
<BoxButton
aria-label={t('Sort the teams')}
aria-label={
isSortAsc
? t('Sort the teams by creation date descendent')
: t('Sort the teams by creation date ascendent')
}
onClick={changeOrdering}
$radius="100%"
$background={
ordering === TeamsOrdering.BY_CREATED_ON
? colorsTokens()['primary-200']
: 'transparent'
}
$background={isSortAsc ? colorsTokens()['primary-200'] : 'transparent'}
$color={colorsTokens()['primary-600']}
>
<IconSort width={30} height={30} aria-label={t('Sort teams icon')} />