Abmelde-Icon neben Hell/Dunkel im App-Kopf
This commit is contained in:
1 parent
ab33ee94e5
commit
2b3bdade15
1 file changed
+7
-7
@@ -696,7 +696,7 @@ test("shows the login view when auth is enabled without a session", async () =>
|
||||
expect(screen.queryByText("2:30 Std.")).toBeNull();
|
||||
});
|
||||
|
||||
test("shows a logout icon in settings when signed in", async () => {
|
||||
test("shows a logout icon in the header next to the theme toggle", async () => {
|
||||
const { getAuthStatus } = await import("@/lib/auth-client");
|
||||
vi.mocked(getAuthStatus).mockResolvedValue({
|
||||
enabled: true,
|
||||
@@ -708,11 +708,12 @@ test("shows a logout icon in settings when signed in", async () => {
|
||||
mockApp(true);
|
||||
render(<Home />);
|
||||
await screen.findByText("2:30 Std.");
|
||||
expect(screen.queryByRole("button", { name: "Abmelden" })).toBeNull();
|
||||
fireEvent.click(screen.getByRole("tab", { name: "Einstellungen" }));
|
||||
expect(
|
||||
screen.getByRole("button", { name: "Abmelden" }),
|
||||
).toBeInTheDocument();
|
||||
const header = document.querySelector(".app-header") as HTMLElement;
|
||||
const actions = within(header).getAllByRole("button");
|
||||
expect(actions.map((button) => button.getAttribute("aria-label"))).toEqual([
|
||||
"Dunkelmodus",
|
||||
"Abmelden",
|
||||
]);
|
||||
});
|
||||
|
||||
test("returns to login after signing out", async () => {
|
||||
@@ -735,7 +736,6 @@ test("returns to login after signing out", async () => {
|
||||
mockApp(true);
|
||||
render(<Home />);
|
||||
await screen.findByText("2:30 Std.");
|
||||
fireEvent.click(screen.getByRole("tab", { name: "Einstellungen" }));
|
||||
fireEvent.click(screen.getByRole("button", { name: "Abmelden" }));
|
||||
await vi.waitFor(() => expect(signOut).toHaveBeenCalled());
|
||||
expect(
|
||||
|
||||
Reference in new issue
Block a user