diff --git a/.github/workflows/chromatic.yaml b/.github/workflows/chromatic similarity index 100% rename from .github/workflows/chromatic.yaml rename to .github/workflows/chromatic diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml new file mode 100644 index 0000000..4997a91 --- /dev/null +++ b/.github/workflows/deploy.yaml @@ -0,0 +1,21 @@ +name: "Deploy to Github Pages" + +on: + push: + branches: + - develop + - main + +jobs: + lint_and_test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: "npm" + - run: npm ci + - run: npm run lint + - run: npm run test diff --git a/src/components/Counter/index.spec.tsx b/src/components/Counter/index.spec.tsx deleted file mode 100644 index cd8ced2..0000000 --- a/src/components/Counter/index.spec.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { render, screen } from "@testing-library/react"; -import Counter from "."; -import userEvent from "@testing-library/user-event"; -import { vi } from "vitest"; -import { BasketProvider } from "../../context/Basket/BasketContext"; - -describe("Counter Component Suite Test", () => { - it("should be modify the counter value if user click on quantity button", async () => { - const setOnClicMock = vi.fn(); - - render( - - - , - ); - - expect(setOnClicMock()).toHaveBeenCalledWith("add"); - - const counterText = await screen.findByRole("paragraph", { name: "1" }); - expect(counterText).toBeInTheDocument(); - }); -}); diff --git a/src/components/Dropdown/BasketDropdown/index.spec.tsx b/src/components/Dropdown/BasketDropdown/index.spec.tsx index 3f8bd5b..d1cd0c8 100644 --- a/src/components/Dropdown/BasketDropdown/index.spec.tsx +++ b/src/components/Dropdown/BasketDropdown/index.spec.tsx @@ -14,22 +14,6 @@ describe("Basket Dropdown Suite Test", () => { expect(getByText("Your cart is empty.")).toBeInTheDocument(); }); - /* it("should be display the basket content with items", async () => { - const { getByTestId } = render( - - - {}} /> - , - ); - - const quantityIconsPlus = getByTestId("plus-icon"); - userEvent.click(quantityIconsPlus); - - await waitFor(() => { - expect(screen.queryByText("Your cart is empty.")).toBeNull(); - }); - }); */ - it("should close the dropdown basket if user clicks outside", () => { const setIsOpenMock = vi.fn();