Migrate to Vue 3 and Vite
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
@@ -127,3 +127,28 @@ export const configMock = {
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const loginMock = {
|
||||
data: {
|
||||
config: {
|
||||
__typename: "Config",
|
||||
auth: {
|
||||
__typename: "Auth",
|
||||
oauthProviders: [],
|
||||
},
|
||||
registrationsOpen: true,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const anonymousActorIdMock = {
|
||||
data: {
|
||||
config: {
|
||||
__typename: "Config",
|
||||
anonymous: {
|
||||
__typename: "Anonymous",
|
||||
actorId: "1",
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@@ -15,11 +15,7 @@ export const fetchEventBasicMock = {
|
||||
__typename: "ParticipantStats",
|
||||
notApproved: 0,
|
||||
notConfirmed: 0,
|
||||
rejected: 0,
|
||||
participant: 0,
|
||||
creator: 1,
|
||||
moderator: 0,
|
||||
administrator: 0,
|
||||
going: 1,
|
||||
},
|
||||
},
|
||||
@@ -61,7 +57,7 @@ export const joinEventMock = {
|
||||
email: "some@email.tld",
|
||||
message: "a message long enough",
|
||||
locale: "en_US",
|
||||
timezone: "UTC",
|
||||
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
||||
};
|
||||
|
||||
export const eventNoCommentThreadsMock = {
|
||||
@@ -152,8 +148,9 @@ export const eventCommentThreadsMock = {
|
||||
export const newCommentForEventMock = {
|
||||
eventId: "1",
|
||||
text: "my new comment",
|
||||
inReplyToCommentId: null,
|
||||
inReplyToCommentId: undefined,
|
||||
isAnnouncement: false,
|
||||
originCommentId: undefined,
|
||||
};
|
||||
|
||||
export const newCommentForEventResponse: DataMock = {
|
||||
|
||||
26
js/tests/unit/specs/mocks/matchMedia.ts
Normal file
26
js/tests/unit/specs/mocks/matchMedia.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { vi } from "vitest";
|
||||
|
||||
window.matchMedia = vi.fn().mockImplementation((query) => ({
|
||||
matches: false,
|
||||
media: query,
|
||||
onchange: null,
|
||||
addListener: vi.fn(), // deprecated
|
||||
removeListener: vi.fn(), // deprecated
|
||||
addEventListener: vi.fn(),
|
||||
removeEventListener: vi.fn(),
|
||||
dispatchEvent: vi.fn(),
|
||||
}));
|
||||
|
||||
// Object.defineProperty(window, "matchMedia", {
|
||||
// writable: true,
|
||||
// value: vi.fn().mockImplementation((query) => ({
|
||||
// matches: false,
|
||||
// media: query,
|
||||
// onchange: null,
|
||||
// addListener: vi.fn(), // deprecated
|
||||
// removeListener: vi.fn(), // deprecated
|
||||
// addEventListener: vi.fn(),
|
||||
// removeEventListener: vi.fn(),
|
||||
// dispatchEvent: vi.fn(),
|
||||
// })),
|
||||
// });
|
||||
Reference in New Issue
Block a user