Skip to content

Commit

Permalink
chore: fix flaky agents & custom fields tables tests (#30580)
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSchoeler authored Oct 5, 2023
1 parent dea1fe9 commit aab18ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const AgentsTable = ({ reload }: { reload: MutableRefObject<() => void> }) => {
)}
{isSuccess && data?.users.length > 0 && (
<>
<GenericTable>
<GenericTable aria-busy={filter !== debouncedFilter} aria-live='assertive'>
<GenericTableHeader>{headers}</GenericTableHeader>
<GenericTableBody data-qa='GenericTableAgentInfoBody'>
{data?.users.map((user) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ const CustomFieldsTable = ({ reload }: { reload: MutableRefObject<() => void> })
);

const getCustomFields = useEndpoint('GET', '/v1/livechat/custom-fields');
const { data, isSuccess, isLoading, refetch } = useQuery(['livechat-customFields', query], async () => getCustomFields(query));
const { data, isSuccess, isLoading, refetch } = useQuery(['livechat-customFields', query, debouncedFilter], async () =>
getCustomFields(query),
);

const [defaultQuery] = useState(hashQueryKey([query]));
const queryHasChanged = defaultQuery !== hashQueryKey([query]);
Expand Down Expand Up @@ -105,7 +107,7 @@ const CustomFieldsTable = ({ reload }: { reload: MutableRefObject<() => void> })

{isSuccess && data.customFields.length > 0 && (
<>
<GenericTable data-qa='GenericTableCustomFieldsInfoBody'>
<GenericTable data-qa='GenericTableCustomFieldsInfoBody' aria-busy={filter !== debouncedFilter} aria-live='assertive'>
<GenericTableHeader>{headers}</GenericTableHeader>
<GenericTableBody>
{data.customFields.map(({ label, _id, scope, visibility }) => (
Expand Down

0 comments on commit aab18ef

Please sign in to comment.