diff --git a/app/src/i18n/locales/en/plans.json b/app/src/i18n/locales/en/plans.json index b001502..ac664f4 100644 --- a/app/src/i18n/locales/en/plans.json +++ b/app/src/i18n/locales/en/plans.json @@ -161,6 +161,7 @@ "removeDayLabel": "Remove day", "removeDayAria": "Remove day", "historyBadge": "History", + "dayHeading": "Now planning {{day}}", "removeLockedTitle": "Remove a day with history?", "removeLockedDesc": "{{day}} has training history (sessions or a settled status). The day will disappear from the plan, calendar and stats, but the training history will be kept. The change is recorded in the plan history along with your note.", "removeLockedLabel": "Remove despite history", diff --git a/app/src/i18n/locales/pl/plans.json b/app/src/i18n/locales/pl/plans.json index 8bd1aa6..be4b56b 100644 --- a/app/src/i18n/locales/pl/plans.json +++ b/app/src/i18n/locales/pl/plans.json @@ -161,6 +161,7 @@ "removeDayLabel": "Usuń dzień", "removeDayAria": "Usuń dzień", "historyBadge": "Historia", + "dayHeading": "Planujesz teraz {{day}}", "removeLockedTitle": "Usunąć dzień z historią?", "removeLockedDesc": "{{day}} ma historię treningów (sesje lub rozliczony status). Dzień zniknie z planu, kalendarza i statystyk, ale historia treningowa zostanie zachowana. Zmiana trafi do historii planu razem z notatką.", "removeLockedLabel": "Usuń mimo historii", diff --git a/app/src/pages/plans/PlanEditor.tsx b/app/src/pages/plans/PlanEditor.tsx index 2eef80e..652e8a3 100644 --- a/app/src/pages/plans/PlanEditor.tsx +++ b/app/src/pages/plans/PlanEditor.tsx @@ -767,8 +767,8 @@ export default function PlanEditor() { > -

- {dayName(activeDay.dayOfWeek)} +

+ {t('wizard.dayHeading', { day: dayName(activeDay.dayOfWeek) })}

{isPlanActive && activeDay.hasHistory && ( diff --git a/app/test/PlanEditor.test.tsx b/app/test/PlanEditor.test.tsx index da4204f..108ba86 100644 --- a/app/test/PlanEditor.test.tsx +++ b/app/test/PlanEditor.test.tsx @@ -449,21 +449,25 @@ describe('PlanEditor — data startu i menu kontekstowe', () => { await user.click(screen.getByRole('button', { name: 'Poniedziałek' })); await user.click(screen.getByRole('button', { name: 'dodaj ćwiczenie…' })); await user.click(await screen.findByRole('option', { name: /Przysiady/ })); - expect(screen.getByRole('heading', { name: 'Poniedziałek' })).toBeInTheDocument(); + expect( + screen.getByRole('heading', { name: 'Planujesz teraz Poniedziałek' }), + ).toBeInTheDocument(); expect(screen.queryByRole('button', { name: 'Następny dzień' })).not.toBeInTheDocument(); expect(screen.queryByRole('button', { name: 'Poprzedni dzień' })).not.toBeInTheDocument(); // dodanie Środy (szara komórka) przenosi edycję na nią; nazwa dnia = siatka + nagłówek const dayGroup = screen.getByRole('group', { name: 'Dni treningowe' }); await user.click(within(dayGroup).getByRole('button', { name: 'Środa' })); - expect(screen.getByRole('heading', { name: 'Środa' })).toBeInTheDocument(); + expect(screen.getByRole('heading', { name: 'Planujesz teraz Środa' })).toBeInTheDocument(); expect(screen.queryByText('Przysiady')).not.toBeInTheDocument(); expect(screen.getAllByRole('button', { name: 'Środa' })).toHaveLength(1); // klik w pomarańczowy, nieedytowany dzień = przełączenie edytora — NIE usuwanie await user.click(within(dayGroup).getByRole('button', { name: 'Poniedziałek' })); expect(screen.queryByRole('dialog')).not.toBeInTheDocument(); - expect(screen.getByRole('heading', { name: 'Poniedziałek' })).toBeInTheDocument(); + expect( + screen.getByRole('heading', { name: 'Planujesz teraz Poniedziałek' }), + ).toBeInTheDocument(); expect(screen.getByText('Przysiady')).toBeInTheDocument(); expect(screen.getByText('1 ćwiczenie')).toBeInTheDocument(); @@ -477,7 +481,9 @@ describe('PlanEditor — data startu i menu kontekstowe', () => { ); await user.click(within(dayGroup).getByRole('button', { name: 'Poniedziałek' })); expect(screen.queryByRole('dialog')).not.toBeInTheDocument(); - expect(screen.getByRole('heading', { name: 'Poniedziałek' })).toBeInTheDocument(); + expect( + screen.getByRole('heading', { name: 'Planujesz teraz Poniedziałek' }), + ).toBeInTheDocument(); }); it('krok 2: kosze w nagłówku dnia usuwają dzień z ćwiczeniami po potwierdzeniu', async () => {