This commit is contained in:
Tykayn 2021-12-09 16:02:54 +01:00 committed by tykayn
commit 8b9b1f7acc
3 changed files with 23 additions and 28 deletions

View File

@ -6,7 +6,7 @@
import { Component, Prop, Vue } from "vue-property-decorator";
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import MobilizonLogo from "../assets/logo_chapril_mobilizon.png";
// import MobilizonLogo from "../assets/logo_chapril_mobilizon.png";
@Component
export default class Logo extends Vue {

View File

@ -106,29 +106,27 @@ const decreaseFetches = () => {
Cypress.env("fetchCount", count - 1);
};
const buildTrackableFetchWithSessionId = (fetch) => (
fetchUrl,
fetchOptions
) => {
const { headers } = fetchOptions;
const modifiedHeaders = {
"x-session-id": Cypress.env("sessionId"),
...headers,
const buildTrackableFetchWithSessionId =
(fetch) => (fetchUrl, fetchOptions) => {
const { headers } = fetchOptions;
const modifiedHeaders = {
"x-session-id": Cypress.env("sessionId"),
...headers,
};
const modifiedOptions = { ...fetchOptions, headers: modifiedHeaders };
return fetch(fetchUrl, modifiedOptions)
.then((result) => {
decreaseFetches();
return Promise.resolve(result);
})
.catch((result) => {
decreaseFetches();
return Promise.reject(result);
});
};
const modifiedOptions = { ...fetchOptions, headers: modifiedHeaders };
return fetch(fetchUrl, modifiedOptions)
.then((result) => {
decreaseFetches();
return Promise.resolve(result);
})
.catch((result) => {
decreaseFetches();
return Promise.reject(result);
});
};
Cypress.on("window:before:load", (win) => {
cy.stub(win, "fetch", buildTrackableFetchWithSessionId(fetch));
});

View File

@ -86,8 +86,7 @@ export const eventCommentThreadsMock = {
__typename: "Comment",
id: "2",
uuid: "e37910ea-fd5a-4756-9679-00971f3f4107",
url:
"https://some-instance.tld/comments/e37910ea-fd5a-4756-9679-00971f3f4107",
url: "https://some-instance.tld/comments/e37910ea-fd5a-4756-9679-00971f3f4107",
text: "my comment text",
local: true,
visibility: "PUBLIC",
@ -118,8 +117,7 @@ export const eventCommentThreadsMock = {
__typename: "Comment",
id: "29",
uuid: "e37910ea-fd5a-4756-9679-01171f3f4107",
url:
"https://some-instance.tld/comments/e37910ea-fd5a-4756-9679-01171f3f4107",
url: "https://some-instance.tld/comments/e37910ea-fd5a-4756-9679-01171f3f4107",
text: "a second comment",
local: true,
visibility: "PUBLIC",
@ -164,8 +162,7 @@ export const newCommentForEventResponse: DataMock = {
__typename: "Comment",
id: "79",
uuid: "e37910ea-fd5a-4756-9679-01171f3f4444",
url:
"https://some-instance.tld/comments/e37910ea-fd5a-4756-9679-01171f3f4444",
url: "https://some-instance.tld/comments/e37910ea-fd5a-4756-9679-01171f3f4444",
text: newCommentForEventMock.text,
local: true,
visibility: "PUBLIC",