Skip to content

Commit 327dea7

Browse files
author
Michael Stelly
committed
fix: Jest configuration syntax error and test file standardization
- Fixed testMatch pattern in jest.config.js (removed extra '>' character) - Renamed Select.test.tsx to Select.spec.tsx for consistency - Moved Select test to proper __tests__ directory structure - Updated import path and snapshot for relocated test file - All 4 test suites now pass with 18 tests total
1 parent acf9a53 commit 327dea7

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ module.exports = {
55
'^.+\\.(js|jsx|ts|tsx)?$': 'ts-jest',
66
},
77
transformIgnorePatterns: ['<rootDir>/node_modules/'],
8-
testMatch: ['<rootDir>>/__tests__/**/*.spec.(js|jsx|ts|tsx)'],
8+
testMatch: ['<rootDir>/__tests__/**/*.spec.(js|jsx|ts|tsx)'],
99
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
1010
}

src/components/common/Select.test.tsx renamed to src/__tests__/components/common/Select.spec.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import { render } from '@testing-library/react'
3-
import Select from './Select'
3+
import Select from '../../../components/common/Select'
44

55
it('renders without crashing', () => {
66
const { container } = render(
@@ -16,11 +16,13 @@ it('renders without crashing', () => {
1616
<div
1717
class="css-1ago99h"
1818
>
19-
<h4>
19+
<h5
20+
class="ant-typography css-dev-only-do-not-override-1rqnfsa"
21+
>
2022
The title
21-
</h4>
23+
</h5>
2224
<div
23-
class="ant-select css-1ago99h ant-select-lg ant-select-single ant-select-show-arrow"
25+
class="ant-select ant-select-lg ant-select-outlined css-1ago99h css-dev-only-do-not-override-1rqnfsa ant-select-single ant-select-show-arrow"
2426
>
2527
<div
2628
class="ant-select-selector"
@@ -29,9 +31,9 @@ it('renders without crashing', () => {
2931
class="ant-select-selection-search"
3032
>
3133
<input
32-
aria-activedescendant="rc_select_TEST_OR_SSR_list_0"
3334
aria-autocomplete="list"
3435
aria-controls="rc_select_TEST_OR_SSR_list"
36+
aria-expanded="false"
3537
aria-haspopup="listbox"
3638
aria-owns="rc_select_TEST_OR_SSR_list"
3739
autocomplete="off"
@@ -40,11 +42,14 @@ it('renders without crashing', () => {
4042
readonly=""
4143
role="combobox"
4244
style="opacity: 0;"
45+
type="search"
46+
unselectable="on"
4347
value=""
4448
/>
4549
</span>
4650
<span
4751
class="ant-select-selection-item"
52+
title="one option"
4853
>
4954
one option
5055
</span>
@@ -57,12 +62,11 @@ it('renders without crashing', () => {
5762
>
5863
<span
5964
aria-label="down"
60-
class="anticon anticon-down"
65+
class="anticon anticon-down ant-select-suffix"
6166
role="img"
6267
>
6368
<svg
6469
aria-hidden="true"
65-
class=""
6670
data-icon="down"
6771
fill="currentColor"
6872
focusable="false"

0 commit comments

Comments
 (0)