> job-tracker-ui@0.1.0 test > jest --runInBand admin-users-page.test.tsx console.error An update to AdminUsersPage inside a test was not wrapped in act(...). When testing, code that causes React state updates should be wrapped into act(...): act(() => { /* fire events that update state */ }); /* assert on the output */ This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act 66 | return () => { checkSessionCookie(); return lifetime.mounted && lifetime.generation===generation && !isSessionInvalidated() && getSessionContext()===context; }; 67 | }, []); > 68 | const finishAction=useCallback((active: () => boolean) => { owner.current.busy=false; if (active()) setBusy(false); }, []); | ^ 69 | 70 | const createUser=async () => { 71 | if (!canCreate) return; at node_modules/react-dom/cjs/react-dom-client.development.js:18758:19 at runWithFiberInDEV (node_modules/react-dom/cjs/react-dom-client.development.js:874:13) at warnIfUpdatesNotWrappedWithActDEV (node_modules/react-dom/cjs/react-dom-client.development.js:18757:9) at scheduleUpdateOnFiber (node_modules/react-dom/cjs/react-dom-client.development.js:16409:11) at dispatchSetStateInternal (node_modules/react-dom/cjs/react-dom-client.development.js:9170:13) at dispatchSetState (node_modules/react-dom/cjs/react-dom-client.development.js:9127:7) at setBusy (src/views/AdminUsersPage.tsx:68:103) at finishAction (src/views/AdminUsersPage.tsx:123:15) node.exe : FAIL src/admin-users-page.test.tsx (13.775 s) At line:1 char:1 + & "C:\Program Files\nodejs/node.exe" "C:\Program Files\nodejs/node_mo ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (FAIL src/admin-....tsx (13.775 s):String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError ● reports 2FA state without mistaking an older response for disabled (mobile true) Unable to find an element with the text: 2FA enabled. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. Ignored nodes: comments, script, style  
       
  The final administrator is protected. Removing your own administrator role requires explicit confirmation.       Create user         Email       Email        New password     75 | expect(await screen.findByText('2FA enabled')).toBeVisible(); | ^ 76 | expect(screen.getByText('2FA disabled')).toBeVisible(); 77 | expect(screen.getByText('2FA status unavailable')).toBeVisible(); 78 | expect(mockedApi.get).toHaveBeenCalledWith('/users'); at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:163:27) at node_modules/@testing-library/dom/dist/query-helpers.js:86:33 at findByText (src/admin-users-page.test.tsx:75:23) ● reports 2FA state without mistaking an older response for disabled (mobile false) Unable to find an element with the text: 2FA enabled. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible. Ignored nodes: comments, script, style  
       
  The final administrator is protected. Removing your own administrator role requires explicit confirmation.       Create user         Email       Email        New password     75 | expect(await screen.findByText('2FA enabled')).toBeVisible(); | ^ 76 | expect(screen.getByText('2FA disabled')).toBeVisible(); 77 | expect(screen.getByText('2FA status unavailable')).toBeVisible(); 78 | expect(mockedApi.get).toHaveBeenCalledWith('/users'); at waitForWrapper (node_modules/@testing-library/dom/dist/wait-for.js:163:27) at node_modules/@testing-library/dom/dist/query-helpers.js:86:33 at findByText (src/admin-users-page.test.tsx:75:23) Test Suites: 1 failed, 1 total Tests: 2 failed, 12 passed, 14 total Snapshots: 0 total Time: 14.829 s, estimated 15 s Ran all test suites matching admin-users-page.test.tsx.