Migrate to Vue 3 and Vite

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2022-07-12 10:55:28 +02:00
parent 8f4099ee33
commit ee20e03cc2
464 changed files with 31515 additions and 32758 deletions

View File

@@ -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",
},
},
},
};

View File

@@ -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 = {

View 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(),
// })),
// });