Skip to content

Commit

Permalink
Manually update Prettier to 2.5.1 in tnoodle-ui
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorbg committed Feb 11, 2022
1 parent c119a64 commit cb071d4
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 156 deletions.
2 changes: 1 addition & 1 deletion tnoodle-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@
},
"devDependencies": {
"@types/lodash": "^4.14.168",
"prettier": "^2.2.1"
"prettier": "^2.5.1"
}
}
5 changes: 2 additions & 3 deletions tnoodle-ui/src/main/components/VersionInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import { setOfficialZipStatus } from "../redux/slice/ScramblingSlice";

const VersionInfo = () => {
const [currentTnoodle, setCurrentTnoodle] = useState<CurrentTnoodle>();
const [allowedTnoodleVersions, setAllowedTnoodleVersions] = useState<
string[]
>();
const [allowedTnoodleVersions, setAllowedTnoodleVersions] =
useState<string[]>();
const [runningVersion, setRunningVersion] = useState<string>();
const [signedBuild, setSignedBuild] = useState<boolean>();
const [signatureKeyBytes, setSignatureKeyBytes] = useState<string>();
Expand Down
44 changes: 15 additions & 29 deletions tnoodle-ui/src/test/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,8 @@ beforeEach(() => {
Promise.resolve({ data: formats, ...axiosResponse })
);

jest.spyOn(
tnoodleApi,
"fetchAvailableFmcTranslations"
).mockImplementation(() =>
Promise.resolve({ data: languages, ...axiosResponse })
jest.spyOn(tnoodleApi, "fetchAvailableFmcTranslations").mockImplementation(
() => Promise.resolve({ data: languages, ...axiosResponse })
);

jest.spyOn(tnoodleApi, "fetchRunningVersion").mockImplementation(() =>
Expand All @@ -82,11 +79,8 @@ beforeEach(() => {
Promise.resolve({ data: scrambleProgram, ...axiosResponse })
);

jest.spyOn(
wcaApi,
"getUpcomingManageableCompetitions"
).mockImplementation(() =>
Promise.resolve({ ...axiosResponse, data: competitions })
jest.spyOn(wcaApi, "getUpcomingManageableCompetitions").mockImplementation(
() => Promise.resolve({ ...axiosResponse, data: competitions })
);

jest.spyOn(wcaApi, "fetchMe").mockImplementation(() =>
Expand Down Expand Up @@ -343,11 +337,9 @@ it("Logged user", async () => {

jest.spyOn(wcaApi, "isLogged").mockImplementation(() => true);

jest.spyOn(
wcaApi,
"getCompetitionJson"
).mockImplementation((competitionId) =>
Promise.resolve({ ...axiosResponse, data: wcifs[competitionId] })
jest.spyOn(wcaApi, "getCompetitionJson").mockImplementation(
(competitionId) =>
Promise.resolve({ ...axiosResponse, data: wcifs[competitionId] })
);

jest.spyOn(tnoodleApi, "fetchBestMbldAttempt").mockImplementation(() =>
Expand All @@ -357,11 +349,8 @@ it("Logged user", async () => {
})
);

jest.spyOn(
tnoodleApi,
"fetchSuggestedFmcTranslations"
).mockImplementation(() =>
Promise.resolve({ ...axiosResponse, data: ["de", "es", "pt-BR"] })
jest.spyOn(tnoodleApi, "fetchSuggestedFmcTranslations").mockImplementation(
() => Promise.resolve({ ...axiosResponse, data: ["de", "es", "pt-BR"] })
);

// Render component
Expand Down Expand Up @@ -478,22 +467,19 @@ it("Comfort features should not block zip generation", async () => {

jest.spyOn(wcaApi, "isLogged").mockImplementation(() => true);

jest.spyOn(
wcaApi,
"getCompetitionJson"
).mockImplementation((competitionId) =>
Promise.resolve({ ...axiosResponse, data: wcifs[competitionId] })
jest.spyOn(wcaApi, "getCompetitionJson").mockImplementation(
(competitionId) =>
Promise.resolve({ ...axiosResponse, data: wcifs[competitionId] })
);

// Comfort features
jest.spyOn(tnoodleApi, "fetchBestMbldAttempt").mockImplementation(() =>
Promise.resolve({ ...axiosResponse, data: bestMbldAttempt })
);

jest.spyOn(
tnoodleApi,
"fetchSuggestedFmcTranslations"
).mockImplementation(() => Promise.resolve({ ...axiosResponse, data: [] }));
jest.spyOn(tnoodleApi, "fetchSuggestedFmcTranslations").mockImplementation(
() => Promise.resolve({ ...axiosResponse, data: [] })
);

// Render component
await act(async () => {
Expand Down
7 changes: 2 additions & 5 deletions tnoodle-ui/src/test/EventPickerTable.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ beforeEach(() => {
Promise.resolve({ data: formats, ...axiosResponse })
);

jest.spyOn(
tnoodleApi,
"fetchAvailableFmcTranslations"
).mockImplementation(() =>
Promise.resolve({ data: languages, ...axiosResponse })
jest.spyOn(tnoodleApi, "fetchAvailableFmcTranslations").mockImplementation(
() => Promise.resolve({ data: languages, ...axiosResponse })
);
});

Expand Down
7 changes: 2 additions & 5 deletions tnoodle-ui/src/test/Main.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,8 @@ it("There should be only 1 button of type submit, check FMC changes", async () =
Promise.resolve({ data: formats, ...axiosResponse })
);

jest.spyOn(
tnoodleApi,
"fetchAvailableFmcTranslations"
).mockImplementation(() =>
Promise.resolve({ data: languages, ...axiosResponse })
jest.spyOn(tnoodleApi, "fetchAvailableFmcTranslations").mockImplementation(
() => Promise.resolve({ data: languages, ...axiosResponse })
);

// We add suggested FMC so the button Select Suggested appears as well
Expand Down
7 changes: 2 additions & 5 deletions tnoodle-ui/src/test/SideBar.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@ it("Each competition fetched from the website must become a button", async () =>
// Turn on mocking behavior
jest.spyOn(wcaApi, "isLogged").mockImplementation(() => true);

jest.spyOn(
wcaApi,
"getUpcomingManageableCompetitions"
).mockImplementation(() =>
Promise.resolve({ ...axiosResponse, data: competitions })
jest.spyOn(wcaApi, "getUpcomingManageableCompetitions").mockImplementation(
() => Promise.resolve({ ...axiosResponse, data: competitions })
);

jest.spyOn(wcaApi, "fetchMe").mockImplementation(() =>
Expand Down
Loading

0 comments on commit cb071d4

Please sign in to comment.