-
Notifications
You must be signed in to change notification settings - Fork 711
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
2,400 additions
and
2,154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: ["@babel/preset-env", "@babel/preset-react"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const path = require("path"); | ||
|
||
module.exports = { | ||
testEnvironment: "jsdom", // Use jsdom environment for DOM-related tests | ||
roots: ["./src"], // The root directory for running tests | ||
transform: { | ||
"^.+\\.(js|jsx)$": "babel-jest", | ||
}, | ||
testMatch: ["**/__tests__/**/*.js?(x)", "**/?(*.)+(spec|test).js?(x)"], // File patterns for test files | ||
setupFilesAfterEnv: ["@testing-library/jest-dom/extend-expect"], // Setup file to extend Jest with RTL matchers | ||
moduleNameMapper: { | ||
"\\.(css|less|scss|sass)$": "identity-obj-proxy", | ||
"^src/(.*)$": path.resolve(__dirname, "src/$1"), // Add the moduleNameMapper for your alias | ||
}, | ||
transformIgnorePatterns: ["/node_modules/(?!(lodash-es)/)"], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from "react"; | ||
import { render, screen } from "@testing-library/react"; | ||
|
||
import ImageGallery from "../ImageGallery"; | ||
|
||
describe("<ImageGallery />", () => { | ||
const defaultProps = { | ||
items: [ | ||
{ | ||
original: "test.png", | ||
thumbnail: "test_thumb.png", | ||
}, | ||
], | ||
}; | ||
|
||
it("renders slides", () => { | ||
render(<ImageGallery {...defaultProps} />); | ||
const elements = screen.getAllByLabelText("Go to Slide 1"); | ||
// expect a thumbnail and slide label | ||
expect(elements.length).toBe(2); | ||
}); | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.