mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-18 21:16:47 +00:00
test(client): the new cases check a missing result instead of asserting it away
This commit is contained in:
@@ -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()
|
||||
})
|
||||
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user