Correct commentTree failure unit-test - issue #1776
This commit is contained in:
@@ -12,7 +12,6 @@ import {
|
||||
import { CommentModeration } from "@/types/enums";
|
||||
import { IEvent } from "@/types/event.model";
|
||||
import {
|
||||
currentActorClientMock,
|
||||
eventCommentThreadsMock,
|
||||
eventNoCommentThreadsMock,
|
||||
newCommentForEventMock,
|
||||
@@ -28,7 +27,8 @@ import { InMemoryCache } from "@apollo/client/cache";
|
||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||
import { routes } from "@/router";
|
||||
import { dialogPlugin } from "@/plugins/dialog";
|
||||
import { CURRENT_ACTOR_CLIENT } from "@/graphql/actor";
|
||||
import { IDENTITIES } from "@/graphql/actor";
|
||||
import { defaultIdentityMock } from "../../mocks/auth";
|
||||
|
||||
config.global.plugins.push(Oruga);
|
||||
config.global.plugins.push(notifierPlugin);
|
||||
@@ -53,7 +53,7 @@ describe("CommentTree", () => {
|
||||
|
||||
mockClient = createMockClient({
|
||||
cache,
|
||||
resolvers: defaultResolvers,
|
||||
resolvers: defaultResolvers(cache),
|
||||
});
|
||||
|
||||
requestHandlers = {
|
||||
@@ -63,9 +63,7 @@ describe("CommentTree", () => {
|
||||
createCommentForEventMutationHandler: vi
|
||||
.fn()
|
||||
.mockResolvedValue(newCommentForEventResponse),
|
||||
getCurrentActorClientHandler: vi
|
||||
.fn()
|
||||
.mockResolvedValue(currentActorClientMock),
|
||||
identityHandler: vi.fn().mockResolvedValue(defaultIdentityMock),
|
||||
...handlers,
|
||||
};
|
||||
|
||||
@@ -77,10 +75,7 @@ describe("CommentTree", () => {
|
||||
CREATE_COMMENT_FROM_EVENT,
|
||||
requestHandlers.createCommentForEventMutationHandler
|
||||
);
|
||||
mockClient.setRequestHandler(
|
||||
CURRENT_ACTOR_CLIENT,
|
||||
requestHandlers.getCurrentActorClientHandler
|
||||
);
|
||||
mockClient.setRequestHandler(IDENTITIES, requestHandlers.identityHandler);
|
||||
wrapper = shallowMount(CommentTree, {
|
||||
props: {
|
||||
event: { ...eventData },
|
||||
|
||||
Reference in New Issue
Block a user