Rename search-history block 'Вы искали' → 'Ранее искали' (TIRREDESIGN-5)

Spec calls out the exact label change for the recent-searches sidebar
on Schedule and Online-Board start pages. RU was the literal 'Вы
искали' (You searched) — switch to 'Ранее искали' (Previously
searched), matching the section heading and the inline 'Ранее искали
в Онлайн-Табло' / 'Ранее искали в Расписании' captions. Other
locales already used 'Previous searches' / 'Search history' wording
and stay unchanged. Add 2-spec e2e seeding sessionStorage with a
valid history item and asserting the new label appears.
This commit is contained in:
2026-04-23 14:37:19 +03:00
parent bd3bb1450c
commit efe6b8be0a
5 changed files with 59 additions and 9 deletions
@@ -210,7 +210,7 @@ export const OnlineBoardSearchPage: FC<OnlineBoardSearchPageProps> = ({
const { dictionaries } = useDictionaries(language);
const { add: addHistory } = useSearchHistory(language);
// Persist this online-board search into the `Вы искали` sidebar
// Persist this online-board search into the `Ранее искали` sidebar
// history. The hook dedupes by URL, so re-renders / day-tab clicks
// don't bloat storage.
useEffect(() => {
@@ -167,7 +167,7 @@ export const ScheduleSearchPage: FC<ScheduleSearchPageProps> = ({ params }) => {
const activeKind: "outbound" | "inbound" =
direction === "inbound" && inbound ? "inbound" : "outbound";
// Persist this search into the `Вы искали` sidebar history. The hook
// Persist this search into the `Ранее искали` sidebar history. The hook
// dedupes by URL so re-renders / week-tab clicks won't bloat storage.
useEffect(() => {
const url = `/${locale}/${buildScheduleUrl(params)}`;
+3 -3
View File
@@ -36,7 +36,7 @@
"STATUS-PLANNED": "Запланирован",
"TIME_DEPARTURE": "Время отправления",
"TITLE": "Онлайн-Табло",
"YOU_SEARCH": "Вы искали",
"YOU_SEARCH": "Ранее искали",
"LEG": "Перелет",
"TOTAL-FLYING-TIME": "Общее время в пути",
"DETAILS-TITLE": "Детали рейса",
@@ -370,8 +370,8 @@
"INTERMEDIATE-LANDING-PLURAL-OTHER": "Промежуточных посадок",
"LANDING": "Посадка",
"LANDING-TRANSFER": "Трансфер",
"LAST-SEARCH-BOARD": "Вы искали в Онлайн-Табло",
"LAST-SEARCH-SCHEDULE": "Вы искали в Расписании",
"LAST-SEARCH-BOARD": "Ранее искали в Онлайн-Табло",
"LAST-SEARCH-SCHEDULE": "Ранее искали в Расписании",
"LAST-UPDATE": "Последнее обновление",
"MAIN": "Главная",
"NOTE-SYMBOL": "*",
+4 -4
View File
@@ -1,9 +1,9 @@
/**
* Search history sidebar — `Вы искали` accordion.
* Search history sidebar — `Ранее искали` accordion (TIRREDESIGN-5).
*
* Mirrors Angular's `search-history` component: a collapsible
* frame with a `Вы искали` header and a list of recent searches.
* Each row shows a plane icon (online-board) or alarm-clock icon
* Mirrors Angular's `search-history` component: a collapsible frame
* with a `Ранее искали` header and a list of recent searches. Each
* row shows a plane icon (online-board) or alarm-clock icon
* (schedule), the city pair (`Москва — Самара`) and a date row
* (`20.04.2026 - 26.04.2026`, plus inbound dates for round-trip).
*
+50
View File
@@ -0,0 +1,50 @@
import { test, expect } from "@playwright/test";
// TIRREDESIGN-5: the search-history sidebar header must read
// "Ранее искали" (not "Вы искали"). The block exists on Schedule
// and Online-Board start pages once the user has run at least one
// search; we seed a synthetic history entry via localStorage so
// the test is deterministic.
// Matches `searchHistoryItemSchema` in useSearchHistory.ts.
const SEED = [
{
type: "schedule-route" as const,
url: "/ru-ru/schedule/route/MOW-LED-20260427-20260503",
label: "Москва — Санкт-Петербург",
params: {
departure: "MOW",
arrival: "LED",
dateFrom: "20260427",
dateTo: "20260503",
},
},
];
async function seedHistory(page: import("@playwright/test").Page) {
// Storage uses sessionStorage with the `afl_` namespace prefix and is
// keyed `history_${lang}` — see src/shared/hooks/useSearchHistory.ts.
await page.addInitScript((items) => {
window.sessionStorage.setItem("afl_history_ru", JSON.stringify(items));
}, SEED);
}
test.describe("Search-history label is 'Ранее искали' (TIRREDESIGN-5)", () => {
test("Schedule start page", async ({ page }) => {
await seedHistory(page);
await page.goto("/ru-ru/schedule");
const block = page.getByTestId("search-history");
await expect(block).toBeVisible({ timeout: 15000 });
await expect(block).toContainText("Ранее искали");
await expect(block).not.toContainText("Вы искали");
});
test("Online-Board start page", async ({ page }) => {
await seedHistory(page);
await page.goto("/ru-ru/onlineboard");
const block = page.getByTestId("search-history");
await expect(block).toBeVisible({ timeout: 15000 });
await expect(block).toContainText("Ранее искали");
await expect(block).not.toContainText("Вы искали");
});
});