Skip to content

Fix: Unexpected failing of vitest in PR workflows (Long Term) #3685

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
...JSON.parse(JSON.stringify(i18n.getDataByLanguage('en')?.errors ?? {})),
};

const debounceWait = async (ms = 300): Promise<void> => {
const debounceWait = async (ms = 250): Promise<void> => {
await act(() => {
return new Promise((resolve) => {
setTimeout(resolve, ms);
Expand Down Expand Up @@ -198,7 +198,7 @@

it('Search by Category name', async () => {
renderActions(link1);
await waitFor(async () => {

Check failure on line 201 in src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx

View workflow job for this annotation

GitHub Actions / Test Application

src/screens/UserPortal/Volunteer/Actions/Actions.spec.tsx > Testing Actions Screen > Search by Category name

Error: Timed out in waitFor. Ignored nodes: comments, script, style <html> <head> <meta content="" name="emotion-insertion-point" /> </head> <body> <div> <div> <div class="_btnsContainer_658d08 gap-4 flex-wrap" > <div class="mb-1 _input_658d08" > <input autocomplete="off" class="_inputField_658d08 form-control" data-testid="searchBy" placeholder="Search by Category" required="" type="text" value="" /> <button class=" _searchButton_658d08 btn btn-primary" data-testid="searchBtn" tabindex="-1" type="button" > <svg aria-hidden="true" class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium _searchIcon_658d08 css-1umw9bq-MuiSvgIcon-root" data-testid="SearchIcon" focusable="false" viewBox="0 0 24 24" > <path d="M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14" /> </svg> </button> </div> <div class="d-flex gap-3 mb-1" > <div class="d-flex justify-space-between align-items-center gap-3" > <div aria-expanded="false" class="dropdown" > <button aria-expanded="false" class="_dropdown_658d08 dropdown-toggle btn btn-success" data-testid="searchByToggle" id="react-aria-:r51:" type="button" > <svg aria-hidden="true" class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium me-1 css-1umw9bq-MuiSvgIcon-root" data-testid="SortIcon" focusable="false" viewBox="0 0 24 24" > <path d="M3 18h6v-2H3zM3 6v2h18V6zm0 7h12v-2H3z" /> </svg> Search by </button> </div> <div aria-expanded="false" class="dropdown" > <button aria-expanded="false" class="_dropdown_658d08 dropdown-toggle btn btn-success" data-testid="sort" id="react-aria-:r52:" type="button" > <svg aria-hidden="true" class="MuiSvgIcon-root MuiSvgIcon-fontSizeMedium me-1 css-1umw9bq-MuiSvgIcon-root" data-testid="SortIcon" focusable="false" viewBox="0 0 24 24" > <path d="M3 18h6v-2H3zM3 6v2h18V6zm0 7h12v-2H3z" /> </svg> Sort </button> </div> </div> </div> </div> <div class="MuiDataGrid-root MuiDataGrid-autoHeight MuiDataGrid-root--densityStandard MuiDataGrid-root--noToolbar MuiDataGrid-withBorderColor css-4sr0bm-MuiDataGrid-root" style="--DataGrid-hasScrollX: 0; --DataGrid-hasScrollY: 0; --DataGrid-scrollbarSize: 0px; --DataGrid-rowWidth: 0px; --DataGrid-columnsTotalWidth: 0px; --DataGrid-leftPinnedWidth: 0px; --DataGrid-rightPinnedWidth: 0px; --DataGrid-headerHeight: 56px; --DataGrid-headersTotalHeight: 56px; --DataGrid-topContainerHeight: 56px; --DataGrid-bottomContainerHeight: 0px; --height: 65px;" >
const searchInput = await screen.findByTestId('searchBy');
expectVitestToBeInTheDocument(searchInput);

Expand Down
2 changes: 1 addition & 1 deletion vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default defineConfig({
globals: true,
environment: 'jsdom',
setupFiles: 'vitest.setup.ts',
testTimeout: 10000,
testTimeout: 30000,
coverage: {
enabled: true,
provider: 'istanbul',
Expand Down
Loading