[ui] Sunrise: The garden names the real sunrise from sunset until it comes
This commit is contained in:
@@ -89,11 +89,23 @@ describe('the garden remembers', () => {
|
||||
expect(screen.queryByRole('searchbox')).toBeNull();
|
||||
});
|
||||
|
||||
it('after the sunset, it speaks of tomorrow\'s', async () => {
|
||||
it("after the sunset, it names tomorrow's sunrise (sunrise.md)", async () => {
|
||||
const after = invitation(sunDay('2026-03-29', brno)) + 60_000;
|
||||
render(Shell, { sunset: wiring({ saved: { kind: 'town', town: brno }, now: () => after }) });
|
||||
const tomorrow = invitation(sunDay('2026-03-30', brno));
|
||||
expect(await screen.findByText(en.sunset.tomorrow(timeOf(brno, tomorrow), 'Brno'))).toBeTruthy();
|
||||
const tomorrow = sunDay('2026-03-30', brno);
|
||||
if (tomorrow.kind !== 'sun-sets') throw new Error('Brno has a sunrise in March');
|
||||
expect(await screen.findByText(en.sunset.risesTomorrow(timeOf(brno, tomorrow.sunrise), 'Brno'))).toBeTruthy();
|
||||
});
|
||||
|
||||
it('before sunrise, it names this morning\'s sunrise; after it, tonight\'s sunset', async () => {
|
||||
const early = Date.parse('2026-03-29T04:00:00+02:00');
|
||||
const today = sunDay('2026-03-29', brno);
|
||||
if (today.kind !== 'sun-sets') throw new Error('Brno has a sunrise in March');
|
||||
render(Shell, { sunset: wiring({ saved: { kind: 'town', town: brno }, now: () => early }) });
|
||||
expect(await screen.findByText(en.sunset.rises(timeOf(brno, today.sunrise), 'Brno'))).toBeTruthy();
|
||||
cleanup();
|
||||
render(Shell, { sunset: wiring({ saved: { kind: 'town', town: brno }, now: () => today.sunrise + 60_000 }) });
|
||||
expect(await screen.findByText(en.sunset.tonight(timeOf(brno, today.sunset), 'Brno'))).toBeTruthy();
|
||||
});
|
||||
|
||||
it('in polar night it speaks of the noon twilight; in polar day, of the lowest light', async () => {
|
||||
|
||||
Reference in New Issue
Block a user