From ac7705ae64bcc9715e0f1041e8e60111eb6d2663 Mon Sep 17 00:00:00 2001 From: "ildar.timerbaev" Date: Tue, 17 Oct 2023 16:40:27 +0600 Subject: [PATCH] Fixed CI --- .../components/decks/_deck-toolbar.scss | 14 +- .../__snapshots__/index.spec.tsx.snap | 99 ------------- .../components/profile-cover/index.spec.tsx | 135 ------------------ src/common/components/tooltip/index.tsx | 2 +- 4 files changed, 6 insertions(+), 244 deletions(-) delete mode 100644 src/common/components/profile-cover/__snapshots__/index.spec.tsx.snap delete mode 100644 src/common/components/profile-cover/index.spec.tsx diff --git a/src/common/components/decks/_deck-toolbar.scss b/src/common/components/decks/_deck-toolbar.scss index b1f563599d5..cd80232f868 100644 --- a/src/common/components/decks/_deck-toolbar.scss +++ b/src/common/components/decks/_deck-toolbar.scss @@ -16,13 +16,11 @@ @include padding-top(0.75rem); @include themify(day) { - @apply bg-white; - @apply border-gray-300; + @apply bg-white border-gray-300; } @include themify(night) { - @apply bg-dark-200; - @apply border-gray-800; + @apply bg-dark-200 border-gray-800; } &::-webkit-scrollbar { @@ -126,13 +124,11 @@ &:hover { @include themify(day) { - @apply bg-gray-100; - @apply text-gray-600; + @apply bg-gray-100 text-gray-600; } @include themify(night) { - @apply bg-dark-default; - @apply text-gray-500; + @apply bg-dark-default text-gray-500; } } @@ -165,7 +161,7 @@ align-items: center; justify-content: center; - @apply duration-300 rounded-full ml-[auto]; + @apply duration-300 ml-[auto] rounded-full; &.switched svg { transform: rotate(180deg); diff --git a/src/common/components/profile-cover/__snapshots__/index.spec.tsx.snap b/src/common/components/profile-cover/__snapshots__/index.spec.tsx.snap deleted file mode 100644 index d75277e04a7..00000000000 --- a/src/common/components/profile-cover/__snapshots__/index.spec.tsx.snap +++ /dev/null @@ -1,99 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`(1) Render with loaded account object 1`] = `null`; - -exports[`(2) Render with mot loaded account object 1`] = ` -
-
-
- - - - - - - - - - -
-
-`; - -exports[`(3) No bg image - Day theme 1`] = `null`; - -exports[`(4) No bg image - Night theme 1`] = `null`; - -exports[`(5) usePrivate = false 1`] = `null`; diff --git a/src/common/components/profile-cover/index.spec.tsx b/src/common/components/profile-cover/index.spec.tsx deleted file mode 100644 index 1e791bab5bb..00000000000 --- a/src/common/components/profile-cover/index.spec.tsx +++ /dev/null @@ -1,135 +0,0 @@ -import React from "react"; - -import ProfileCover from "./index"; -import renderer from "react-test-renderer"; - -import { Theme } from "../../store/global/types"; -import { Account } from "../../store/accounts/types"; - -import { - globalInstance, - UiInstance, - fullAccountInstance, - dynamicPropsIntance1, - RcAccountInstance, - allOver -} from "../../helper/test-helper"; - -jest.mock("../../constants/defaults.json", () => ({ - imageServer: "https://images.ecency.com" -})); - -jest.mock("../../api/hive", () => ({ - getFollowing: () => - new Promise((resolve) => { - resolve([]); - }), - - votingPower: () => 0, - votingValue: () => 0, - findRcAccounts: () => new Promise((resolve) => resolve([RcAccountInstance])) -})); - -const defProps = { - global: { ...globalInstance }, - dynamicProps: dynamicPropsIntance1, - users: [], - activeUser: null, - ui: UiInstance, - setActiveUser: () => {}, - updateActiveUser: () => {}, - deleteUser: () => {}, - toggleUIProp: () => {} -}; - -it("(1) Render with loaded account object", async () => { - const account: Account = { - ...fullAccountInstance, - name: "user1", - profile: { - cover_image: "https://img.esteem.app/rwd380.jpg" - } - }; - - const props = { - ...defProps, - account - }; - - const component = renderer.create(); - await allOver(); - expect(component.toJSON()).toMatchSnapshot(); -}); - -it("(2) Render with mot loaded account object", async () => { - const account: Account = { - name: "user1" - }; - - const props = { - ...defProps, - account - }; - - const component = renderer.create(); - await allOver(); - expect(component.toJSON()).toMatchSnapshot(); -}); - -it("(3) No bg image - Day theme", async () => { - const account: Account = { - ...fullAccountInstance, - name: "user1", - profile: {} - }; - - const props = { - ...defProps, - account - }; - - const component = renderer.create(); - await allOver(); - expect(component.toJSON()).toMatchSnapshot(); -}); - -it("(4) No bg image - Night theme", async () => { - const account: Account = { - ...fullAccountInstance, - name: "user1", - profile: {} - }; - - const props = { - ...defProps, - global: { ...globalInstance, ...{ theme: Theme.night } }, - account - }; - - const component = renderer.create(); - await allOver(); - expect(component.toJSON()).toMatchSnapshot(); -}); - -it("(5) usePrivate = false", async () => { - const account: Account = { - ...fullAccountInstance, - name: "user1", - profile: { - cover_image: "https://img.esteem.app/rwd380.jpg" - } - }; - - const props = { - ...defProps, - account, - global: { - ...globalInstance, - usePrivate: false - } - }; - - const component = renderer.create(); - await allOver(); - expect(component.toJSON()).toMatchSnapshot(); -}); diff --git a/src/common/components/tooltip/index.tsx b/src/common/components/tooltip/index.tsx index 7a27d32312b..f1451525ad3 100644 --- a/src/common/components/tooltip/index.tsx +++ b/src/common/components/tooltip/index.tsx @@ -50,7 +50,7 @@ export function StyledTooltip({ children, content }: StyledProps) { > {content}
, - document.querySelector("#popper-container")!! + document.querySelector("#popper-container") ?? document.createElement("div") )} );