Skip to content

Commit

Permalink
Merge pull request #35 from CalcagnoLoic/develop
Browse files Browse the repository at this point in the history
adding workflow
  • Loading branch information
CalcagnoLoic authored Jan 27, 2024
2 parents 8c374ef + 0e6fa13 commit 5aac6a2
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 44 deletions.
File renamed without changes.
50 changes: 50 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "Deploy to Github Pages"

on:
push:
branches:
- develop
- main

permissions:
contents: read
pages: write
id-token: write

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

build_and_deploy:
runs-on: ubuntu-latest
needs: lint_and_test

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- run: npm ci
- uses: actions/configure-pages@v3
- run: npm run build
- uses: actions/upload-pages-artifact@v2
with:
path: ./dist/
- name: Deploy to GH pages
id: deployment
uses: actions/deploy-pages@v1
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"private": true,
"version": "0.0.0",
"type": "module",
"homepage": "https://calcagnoloic.github.io/ecommerce-sneakers/",
"scripts": {
"dev": "vite",
"dev:format": "prettier --write .",
Expand Down
22 changes: 0 additions & 22 deletions src/components/Counter/index.spec.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions src/components/Dropdown/BasketDropdown/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<BasketProvider>
<Counter />
<BasketDropdown setIsOpen={() => {}} />
</BasketProvider>,
);
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();

Expand Down
8 changes: 4 additions & 4 deletions src/data/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ type NavBar = {
};

export const images: carrouselImage[] = [
{ id: 1, value: "/assets/img/product-1.jpg", key: uuidv4() },
{ id: 2, value: "/assets/img/product-2.jpg", key: uuidv4() },
{ id: 3, value: "/assets/img/product-3.jpg", key: uuidv4() },
{ id: 4, value: "/assets/img/product-4.jpg", key: uuidv4() },
{ id: 1, value: "/ecommerce-sneakers/assets/img/product-1.jpg", key: uuidv4() },
{ id: 2, value: "/ecommerce-sneakers/assets/img/product-2.jpg", key: uuidv4() },
{ id: 3, value: "/ecommerce-sneakers/assets/img/product-3.jpg", key: uuidv4() },
{ id: 4, value: "/ecommerce-sneakers/assets/img/product-4.jpg", key: uuidv4() },
];

export const namesItems: NavBar[] = [
Expand Down
5 changes: 3 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export default defineConfig({
plugins: [react()],
test: {
globals: true,
environment: 'jsdom',
setupFiles: './src/setup.ts',
environment: "jsdom",
setupFiles: "./src/setup.ts",
},
base: "/ecommerce-sneakers/",
});

0 comments on commit 5aac6a2

Please sign in to comment.