fix(notifications): a notice's button is said when shown, like its text
An action label was translated when the notice was raised, so after a language switch a live toast or center row read in one language with its button in the other. The access-requests nudge no longer re-issues on a switch for it. New tests: the button and a server refusal follow a switch.
This commit is contained in:
@@ -9,7 +9,7 @@ import { afterEach, describe, expect, it, onTestFinished, vi } from "vitest";
|
||||
import { act, cleanup, fireEvent, render, screen, waitFor, within } from "@testing-library/react";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import { api, type AppNotification } from "../../lib/api";
|
||||
import { raw, type Notification as ClientNotif } from "../../lib/notifications";
|
||||
import { msg, type Notification as ClientNotif, raw } from "../../lib/notifications";
|
||||
|
||||
const h = vi.hoisted(() => ({
|
||||
server: [] as unknown[],
|
||||
@@ -295,7 +295,7 @@ describe("NotificationsPanel · an activity row", () => {
|
||||
h.client = [
|
||||
client(7, {
|
||||
dismissed: false,
|
||||
action: { label: "feed.undo", onClick: () => {} },
|
||||
action: { label: msg("feed.undo"), onClick: () => {} },
|
||||
meta: { kind: "video-hidden", videoId: "v", channelId: "c" },
|
||||
} as never),
|
||||
];
|
||||
@@ -321,8 +321,8 @@ describe("NotificationsPanel · an activity row", () => {
|
||||
h.client = [
|
||||
client(5, {
|
||||
dismissed: false,
|
||||
action: { label: "tray.done.copyLink", onClick: copy },
|
||||
secondaryAction: { label: "tray.done.open", onClick: open },
|
||||
action: { label: msg("tray.done.copyLink"), onClick: copy },
|
||||
secondaryAction: { label: msg("tray.done.open"), onClick: open },
|
||||
}),
|
||||
];
|
||||
mount();
|
||||
|
||||
Reference in New Issue
Block a user