Skip to content

Commit f8df070

Browse files
committed
Rename function and file
1 parent ca4ab6e commit f8df070

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+129
-125
lines changed

src/components/AuthenticatedRoute.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import AuthenticatedRoute from "./AuthenticatedRoute";
22
import { Auth } from "../support";
33
import { screen } from "@testing-library/react";
4-
import { setComponent } from "../support/testing/testComponent";
4+
import { setTestSubject } from "../support/testing/testSubject";
55
import { PATH_CHOOSE_TEAM, PATH_LOGIN } from "../routes";
66
import { routingDecorator } from "../support/testing/testDecorators";
77

88
jest.mock("../support/auth");
99

1010
describe("<AuthenticatedRoute />", () => {
11-
const { renderComponent, updateDecorator, updateProps } = setComponent(
11+
const { renderComponent, updateDecorator, updateProps } = setTestSubject(
1212
AuthenticatedRoute,
1313
{
1414
decorators: [routingDecorator()],

src/components/Circle/Circle.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { setComponent } from "../../support/testing/testComponent";
1+
import { setTestSubject } from "../../support/testing/testSubject";
22
import CustomCircle from "./Circle";
33
import { screen } from "@testing-library/react";
44

55
describe("<CustomCircle />", () => {
6-
const { setProps, renderComponent } = setComponent(CustomCircle);
6+
const { setProps, renderComponent } = setTestSubject(CustomCircle);
77
setProps({
88
percent: 50,
99
currentKudos: 200,

src/components/navigation/Desktop.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { screen } from "@testing-library/react";
22
import { mockLocalstorage } from "../../spec_helper";
33
import Desktop, { GET_USER } from "./Desktop";
4-
import { setComponent } from "../../support/testing/testComponent";
4+
import { setTestSubject } from "../../support/testing/testSubject";
55
import {
66
dataDecorator,
77
routingDecorator,
@@ -25,7 +25,7 @@ export const mocks = () => [
2525
];
2626

2727
describe("<Desktop />", () => {
28-
const { renderComponent } = setComponent(Desktop, {
28+
const { renderComponent } = setTestSubject(Desktop, {
2929
decorators: [dataDecorator(mocks()), routingDecorator()],
3030
props: {},
3131
});

src/components/navigation/Mobile.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import { mockLocalstorage } from "../../spec_helper";
22
import Mobile from "./Mobile";
33
import { Auth } from "../../support";
44
import { screen } from "@testing-library/react";
5-
import { setComponent } from "../../support/testing/testComponent";
5+
import { setTestSubject } from "../../support/testing/testSubject";
66
import { routingDecorator } from "../../support/testing/testDecorators";
77

88
describe("<Mobile />", () => {
99
mockLocalstorage("fakeToken");
1010

11-
const { renderComponent } = setComponent(Mobile, {
11+
const { renderComponent } = setTestSubject(Mobile, {
1212
decorators: [routingDecorator()],
1313
props: {},
1414
});

src/components/organisms/RepoList/RepoList.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { screen } from "@testing-library/react";
22
import { GET_POSTS } from "../../../modules/feed/queries";
33
import { mockLocalstorage } from "../../../spec_helper";
44
import { RepoList } from "./RepoList";
5-
import { setComponent } from "../../../support/testing/testComponent";
5+
import { setTestSubject } from "../../../support/testing/testSubject";
66
import { dataDecorator } from "../../../support/testing/testDecorators";
77

88
export const mocks = (hasNextPage: boolean) => [
@@ -81,7 +81,7 @@ const mocksWithError = [
8181
];
8282

8383
describe("<RepoList />", () => {
84-
const { renderComponent, updateDecorator } = setComponent(RepoList, {
84+
const { renderComponent, updateDecorator } = setTestSubject(RepoList, {
8585
decorators: [dataDecorator(mocks(false))],
8686
props: {},
8787
});

src/components/upload/ImageUpload.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { setComponent } from "../../support/testing/testComponent";
1+
import { setTestSubject } from "../../support/testing/testSubject";
22
import { ImageUpload } from "./ImageUpload";
33
import { screen, waitFor } from "@testing-library/react";
44
import userEvent from "@testing-library/user-event";
@@ -16,7 +16,7 @@ const createFile = (name: string, size: number, type: string): File => {
1616
describe("<ImageUpload />", () => {
1717
let selectedFiles: any = [];
1818

19-
const { setProps, renderComponent } = setComponent(ImageUpload);
19+
const { setProps, renderComponent } = setTestSubject(ImageUpload);
2020
setProps({
2121
onChange: (files) => {
2222
selectedFiles = files;

src/modules/choose-team/ChooseTeamPage.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Content } from "./ChooseTeamPage";
22
import { screen, fireEvent } from "@testing-library/react";
33
import { GET_INVITES } from "./components/InviteList";
44
import { GET_TEAMS } from "./components/TeamList";
5-
import { setComponent } from "../../support/testing/testComponent";
5+
import { setTestSubject } from "../../support/testing/testSubject";
66
import { dataDecorator } from "../../support/testing/testDecorators";
77

88
const mockHistoryPush = jest.fn();
@@ -86,7 +86,7 @@ const mockWithInvites = [
8686
];
8787

8888
describe("<ChooseTeamPage />", () => {
89-
const { renderComponent } = setComponent(Content, {
89+
const { renderComponent } = setTestSubject(Content, {
9090
decorators: [dataDecorator(mockWithInvites)],
9191
props: {},
9292
});

src/modules/choose-team/CreateTeamPage.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { GraphQLError } from "graphql";
22
import CreateTeamPage, { MUTATION_CREATE_TEAM } from "./CreateTeamPage";
33
import { Storage } from "../../support/storage";
44
import { fireEvent, screen, waitFor } from "@testing-library/react";
5-
import { setComponent } from "../../support/testing/testComponent";
5+
import { setTestSubject } from "../../support/testing/testSubject";
66
import {
77
dataDecorator,
88
routingDecorator,
@@ -35,7 +35,7 @@ const mocksWithError = [
3535
];
3636

3737
describe("<CreateTeamPage />", () => {
38-
const { renderComponent, updateDecorator } = setComponent(CreateTeamPage, {
38+
const { renderComponent, updateDecorator } = setTestSubject(CreateTeamPage, {
3939
decorators: [dataDecorator(mocks), routingDecorator()],
4040
props: {},
4141
});

src/modules/choose-team/components/ChoiceButton.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import ChoiceButton from "./ChoiceButton";
33
import { Storage } from "../../../support/storage";
44
import { screen, waitFor } from "@testing-library/react";
55
import userEvent from "@testing-library/user-event";
6-
import { setComponent } from "../../../support/testing/testComponent";
6+
import { setTestSubject } from "../../../support/testing/testSubject";
77
import { dataDecorator } from "../../../support/testing/testDecorators";
88

99
const fakeMutation = gql`
@@ -39,7 +39,7 @@ jest.mock("react-router-dom", () => ({
3939
}));
4040

4141
describe("<ChoiceButton />", () => {
42-
const { renderComponent, updateProps } = setComponent(ChoiceButton, {
42+
const { renderComponent, updateProps } = setTestSubject(ChoiceButton, {
4343
decorators: [dataDecorator(mocks)],
4444
props: {
4545
inviteId: "1",

src/modules/choose-team/components/Invite.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Invite, InviteModel } from "./Invite";
22
import { screen } from "@testing-library/react";
3-
import { setComponent } from "../../../support/testing/testComponent";
3+
import { setTestSubject } from "../../../support/testing/testSubject";
44
import { dataDecorator } from "../../../support/testing/testDecorators";
55

66
const invite: InviteModel = {
@@ -12,7 +12,7 @@ const invite: InviteModel = {
1212
};
1313

1414
describe("<Invite />", () => {
15-
const { renderComponent } = setComponent(Invite, {
15+
const { renderComponent } = setTestSubject(Invite, {
1616
decorators: [dataDecorator()],
1717
props: { invite },
1818
});

0 commit comments

Comments
 (0)