Skip to content

Commit c4e5057

Browse files
committed
wote test
1 parent dd37d8b commit c4e5057

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { fireEvent, screen } from "@testing-library/react"
2+
import { renderWithAuth } from "testHelpers/renderHelpers"
3+
import { AccountPage } from "pages/UserSettingsPage/AccountPage/AccountPage"
4+
import i18next from "i18next"
5+
6+
const { t } = i18next
7+
8+
describe("AuthAndFrame", () => {
9+
it("sets localStorage key-value when dismissed", async () => {
10+
const localStorageMock = {
11+
...global.localStorage,
12+
getItem: jest.fn(),
13+
}
14+
global.localStorage = localStorageMock
15+
16+
// rendering a random page that is wrapped in AuthAndFrame
17+
return renderWithAuth(<AccountPage />)
18+
fireEvent.click(
19+
screen.getByRole("button", {
20+
name: t("ctas.dismissCta", { ns: "common" }),
21+
}),
22+
)
23+
expect(localStorageMock.getItem).toHaveBeenCalledWith("dismissedVersion")
24+
})
25+
})

0 commit comments

Comments
 (0)