mirror of
https://github.com/aleleba/create-react-component-library.git
synced 2025-07-19 11:08:18 -06:00
PR-342468: fixing test.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
const { pathsToModuleNameMapper } = require('ts-jest');
|
||||
const { compilerOptions } = require('./tsconfig');
|
||||
const { compilerOptions } = require('./tsconfig.json');
|
||||
|
||||
const aliases = pathsToModuleNameMapper(compilerOptions.paths, {
|
||||
prefix: '<rootDir>'
|
||||
@ -14,4 +14,4 @@ module.exports = {
|
||||
'\\.(jpg|ico|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/src/__mocks__/fileMock.ts',
|
||||
'\\.(css|sass|scss|less)$': 'identity-obj-proxy'
|
||||
},
|
||||
};
|
||||
};
|
||||
|
16
package-lock.json
generated
16
package-lock.json
generated
@ -25,6 +25,7 @@
|
||||
"@storybook/cli": "^9.0.17",
|
||||
"@storybook/preset-scss": "^1.0.3",
|
||||
"@storybook/react-webpack5": "^9.0.17",
|
||||
"@testing-library/dom": "^10.4.0",
|
||||
"@testing-library/jest-dom": "^6.6.3",
|
||||
"@testing-library/react": "^16.3.0",
|
||||
"@testing-library/user-event": "^14.6.1",
|
||||
@ -38,7 +39,7 @@
|
||||
"clean-webpack-plugin": "^4.0.0",
|
||||
"css-loader": "^7.1.2",
|
||||
"css-minimizer-webpack-plugin": "^7.0.2",
|
||||
"cypress": "^14.5.1",
|
||||
"cypress": "^14.5.2",
|
||||
"dotenv": "^17.2.0",
|
||||
"eslint": "^9.31.0",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
@ -4853,7 +4854,6 @@
|
||||
"integrity": "sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"@babel/code-frame": "^7.10.4",
|
||||
"@babel/runtime": "^7.12.5",
|
||||
@ -4968,8 +4968,7 @@
|
||||
"resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz",
|
||||
"integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/@types/babel__core": {
|
||||
"version": "7.20.5",
|
||||
@ -8379,8 +8378,7 @@
|
||||
"resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz",
|
||||
"integrity": "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/dom-converter": {
|
||||
"version": "0.2.0",
|
||||
@ -13525,7 +13523,6 @@
|
||||
"integrity": "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"bin": {
|
||||
"lz-string": "bin/bin.js"
|
||||
}
|
||||
@ -15262,7 +15259,6 @@
|
||||
"integrity": "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"dependencies": {
|
||||
"ansi-regex": "^5.0.1",
|
||||
"ansi-styles": "^5.0.0",
|
||||
@ -15278,7 +15274,6 @@
|
||||
"integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true,
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
@ -15497,8 +15492,7 @@
|
||||
"resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.2.tgz",
|
||||
"integrity": "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/readdirp": {
|
||||
"version": "3.6.0",
|
||||
|
@ -48,6 +48,7 @@
|
||||
"@storybook/cli": "^9.0.17",
|
||||
"@storybook/preset-scss": "^1.0.3",
|
||||
"@storybook/react-webpack5": "^9.0.17",
|
||||
"@testing-library/dom": "^10.4.0",
|
||||
"@testing-library/jest-dom": "^6.6.3",
|
||||
"@testing-library/react": "^16.3.0",
|
||||
"@testing-library/user-event": "^14.6.1",
|
||||
@ -61,7 +62,7 @@
|
||||
"clean-webpack-plugin": "^4.0.0",
|
||||
"css-loader": "^7.1.2",
|
||||
"css-minimizer-webpack-plugin": "^7.0.2",
|
||||
"cypress": "^14.5.1",
|
||||
"cypress": "^14.5.2",
|
||||
"dotenv": "^17.2.0",
|
||||
"eslint": "^9.31.0",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
|
@ -2,7 +2,7 @@ import React from 'react';
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { Card } from '@components';
|
||||
|
||||
describe('<App/> Component', () => {
|
||||
describe('<Card/> Component', () => {
|
||||
beforeEach(() => {
|
||||
// fetchMock.resetMocks();
|
||||
render(<Card title='Test Title'><p>Test Content</p></Card>)
|
||||
@ -12,13 +12,13 @@ describe('<App/> Component', () => {
|
||||
//First Data Fetch
|
||||
data: 'data'
|
||||
})); */
|
||||
screen.getByText('Test Title')
|
||||
expect(screen.getByText('Test Title')).toBeInTheDocument();
|
||||
})
|
||||
it('Show Child Component', async () => {
|
||||
/* fetchMock.mockResponseOnce(JSON.stringify({
|
||||
//First Data Fetch
|
||||
data: 'data'
|
||||
})); */
|
||||
screen.getByText('Test Content')
|
||||
expect(screen.getByText('Test Content')).toBeInTheDocument();
|
||||
})
|
||||
})
|
||||
|
Reference in New Issue
Block a user