test(client): the new cases check a missing result instead of asserting it away

This commit is contained in:
Maurice
2026-10-12 19:57:48 +00:00
parent d4c3b1f4e0
commit dbc6cb6b94
2 changed files with 5 additions and 5 deletions
@@ -235,7 +235,7 @@ describe('GalleryView', () => {
await deleteThroughConfirm(user)
await waitFor(() => expect(deleted).toBe(true))
await waitFor(() => expect(useJourneyStore.getState().current!.gallery).toHaveLength(0))
await waitFor(() => expect(useJourneyStore.getState().current?.gallery).toHaveLength(0))
const current = useJourneyStore.getState().current!
expect(current.gallery).toHaveLength(0)
expect(current.entries[0].photos).toHaveLength(0)
@@ -296,7 +296,7 @@ describe('GalleryView', () => {
expect(screen.queryByText('Delete photo')).not.toBeInTheDocument()
expect(deleted).toBe(false)
expect(useJourneyStore.getState().current!.gallery).toHaveLength(1)
expect(useJourneyStore.getState().current?.gallery).toHaveLength(1)
expect(onPhotoClick).not.toHaveBeenCalled()
})
+3 -3
View File
@@ -94,8 +94,8 @@ describe('useLocationBias mit Kartenausschnitt', () => {
seed({ trip: { id: 5 }, places: [KYOTO_A, TOKIO], planMapViewport: KYOTO_VIEW });
const { box, point } = renderHook(() => useLocationBias()).result.current;
expect(box).toEqual({ low: { lat: 34.96, lng: 135.70 }, high: { lat: 35.06, lng: 135.82 } });
expect(point!.lat).toBeCloseTo(35.01, 6);
expect(point!.lng).toBeCloseTo(135.76, 6);
expect(point?.lat).toBeCloseTo(35.01, 6);
expect(point?.lng).toBeCloseTo(135.76, 6);
});
it('schlaegt auch den geoeffneten Tag', () => {
@@ -108,7 +108,7 @@ describe('useLocationBias mit Kartenausschnitt', () => {
planMapViewport: KYOTO_VIEW,
});
const { box } = renderHook(() => useLocationBias()).result.current;
expect(box!.high.lng).toBeLessThan(TOKIO.lng);
expect(box?.high.lng).toBeLessThan(TOKIO.lng);
});
it('faellt bei einem zu weiten Ausschnitt auf den Tag zurueck', () => {