Skip to content

Commit 1a3cac7

Browse files
committed
test: update sorting test cases for mixed data types in dynamic layout
Signed-off-by: Wanjin Noh <[email protected]>
1 parent 71e4357 commit 1a3cac7

File tree

2 files changed

+11
-9
lines changed
  • apps/web
  • packages/mirinae/src/data-display/dynamic/dynamic-layout/templates/raw-table/dynamin-layout-raw-table-data-sorting/__tests__

2 files changed

+11
-9
lines changed

apps/web/.lintstagedrc.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
22
"**/!(*spec).{ts,tsx,js,jsx,vue}": ["eslint --fix --max-warnings=0"],
3-
"**/!(*spec).{ts,tsx,vue}": ["vue-tsc -p tsconfig.json --noEmit"],
3+
"**/!(*spec).{ts,tsx,vue}": ["vue-tsc --noEmit"],
44
"src/**/*.{css,vue,pcss,scss}": ["stylelint --fix"]
55
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import { getSortingData } from '@/utils';
32

43
const mockLoadData = {
@@ -8,7 +7,8 @@ const mockLoadData = {
87
},
98
mixedTexts: {
109
data: ['14일 평균', '10일', '14일', '1일'],
11-
result: ['10일', '14일', '14일 평균', '1일'],
10+
// result: ['10일', '14일', '14일 평균', '1일'],
11+
result: ['1일', '10일', '14일', '14일 평균'],
1212
},
1313
mixedTextsAndNumbers: {
1414
data: ['1년 2월', '1월 3일', '1월 2일', '13', '12'],
@@ -17,18 +17,20 @@ const mockLoadData = {
1717
};
1818

1919
describe('Dynamic layout raw table data sorting', () => {
20-
test('String only: ', () => {
20+
test('String only', () => {
2121
expect(getSortingData(mockLoadData.stringOnly.data))
2222
.toStrictEqual(mockLoadData.stringOnly.result);
2323
});
24-
test('Mixed: ', () => {
25-
it('Sort mixed texts', () => {
24+
25+
describe('Mixed sorting', () => {
26+
test('Sort mixed texts', () => {
2627
expect(getSortingData(mockLoadData.mixedTexts.data))
27-
.toStrictEqual(mockLoadData.mixedTexts.data);
28+
.toStrictEqual(mockLoadData.mixedTexts.result);
2829
});
29-
it('Sort mixed texts and numbers', () => {
30+
31+
test('Sort mixed texts and numbers', () => {
3032
expect(getSortingData(mockLoadData.mixedTextsAndNumbers.data))
31-
.toStrictEqual(mockLoadData.mixedTextsAndNumbers.data);
33+
.toStrictEqual(mockLoadData.mixedTextsAndNumbers.result);
3234
});
3335
});
3436
});

0 commit comments

Comments
 (0)