Fixed bug user test

This commit is contained in:
AmirHossein Mahmoodi
2023-11-01 12:06:28 +03:30
parent edcfcf574e
commit 3dc28de0bd

View File

@@ -46,9 +46,9 @@ describe("First Component From First Page", () => {
});
it("Show Login Button And Do Not Show Dashboard Button When User Authentication Is Expired", async () => {
localStorage.setItem("_token", 'token');
server.use([rest.get(GET_USER, (req, res, ctx) => {
return res(ctx.status(403))
})])
server.use(rest.get(GET_USER, (req, res, ctx) => {
return res(ctx.status(401))
}))
render(<MockAppWithProviders><FirstComponent/></MockAppWithProviders>);
await waitFor(() => {
const authenticationButtonLogin = screen.queryByText(/ورود کارشناس/i)