Skip to content

Commit

Permalink
test: fix broken queries and their mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomakela committed Feb 6, 2024
1 parent 61ef917 commit e82af5a
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions apps/events-helsinki/config/jest/mockDataUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const fakeEvent = (overrides?: Partial<EventDetails>): EventDetails => {
name: fakeLocalizedObject(),
publisher: 'provider:123',
provider: fakeLocalizedObject(),
providerContactInfo: null,
shortDescription: fakeLocalizedObject(),
description: fakeLocalizedObject(),
images: [fakeEventImage()],
Expand Down
1 change: 1 addition & 0 deletions apps/hobbies-helsinki/config/jest/mockDataUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const fakeEvent = (overrides?: Partial<EventDetails>): EventDetails => {
name: fakeLocalizedObject(),
publisher: 'provider:123',
provider: fakeLocalizedObject(),
providerContactInfo: null,
shortDescription: fakeLocalizedObject(),
description: fakeLocalizedObject(),
images: [fakeEventImage()],
Expand Down
1 change: 1 addition & 0 deletions apps/sports-helsinki/config/jest/mockDataUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export const fakeEvent = (overrides?: Partial<EventDetails>): EventDetails => {
audienceMaxAge: '15',
typeId: EventTypeId.Course,
locationExtraInfo: null,
providerContactInfo: null,
__typename: 'EventDetails',
},
overrides
Expand Down
1 change: 1 addition & 0 deletions apps/sports-helsinki/config/jest/mocks/eventListMocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const baseVariables = {
location: [],
pageSize: 10,
publisher: null,
publisherAncestor: null,
sort: 'end_time',
start: 'now',
// superEventType: ['umbrella', 'none'], // Removed to experiment LIIKUNTA-512 (https://helsinkisolutionoffice.atlassian.net/browse/LIIKUNTA-512).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ export const getEventSearchVariables = ({
location: places.sort(),
pageSize,
publisher,
publisherAncestor: null,
sort: sortOrder,
start,
superEventType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,11 @@ describe('upcoming events of a venue', () => {
}
);
await waitForComponentToBeLoaded();
await waitFor(() => {
expect(
screen.getByRole('heading', {
name: translations.venue.upcomingEvents.title,
})
).toBeInTheDocument();

await screen.findByRole('heading', {
name: translations.venue.upcomingEvents.title,
});

await waitFor(() => {
expect(
screen.queryByText('Page has finished loading')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ export const useLocationUpcomingEventsQuery = ({
include: ['keywords', 'location'],
start: 'now',
sort: EVENT_SORT_OPTIONS.END_TIME,
publisherAncestor: null,
// superEventType: 'none', // Removed to experiment LIIKUNTA-512 (https://helsinkisolutionoffice.atlassian.net/browse/LIIKUNTA-512).
pageSize,
};
Expand Down

0 comments on commit e82af5a

Please sign in to comment.