-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'NBO/use_alphabetic_order_in_scenario_list'
- Loading branch information
Showing
3 changed files
with
260 additions
and
21 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,228 @@ | ||
// Copyright (c) Cosmo Tech. | ||
// Licensed under the MIT license. | ||
|
||
export const scenarioList = [ | ||
{ | ||
id: 's-1v9g5kzkv6o3', | ||
name: 'PROD-8310', | ||
parentId: null | ||
}, | ||
{ | ||
id: 's-nn4le5eq42v6', | ||
name: 'SHAM - Test 1', | ||
parentId: null | ||
}, | ||
{ | ||
id: 's-2xdq7wwd620l', | ||
name: 'SHAM - Test 2', | ||
parentId: null | ||
}, | ||
{ | ||
id: 's-0n1r7pqwpd9g', | ||
name: 'SHAM - Test 3', | ||
parentId: null | ||
}, | ||
{ | ||
id: 's-onr272m71o0z', | ||
name: 'SHAM Test 5', | ||
parentId: null | ||
}, | ||
{ | ||
id: 's-j8wkvnn803zp', | ||
name: 'SHAM - Test 6', | ||
parentId: null | ||
}, | ||
{ | ||
id: 's-5lx5zk9k6zgw', | ||
name: 'THU - Test', | ||
parentId: null | ||
}, | ||
{ | ||
id: 's-p7xypk75kdyk', | ||
name: 'JREY - Test refresh parameters', | ||
parentId: null | ||
}, | ||
{ | ||
id: 's-q4v57lx22dm4', | ||
name: 'NBO - test abc1', | ||
parentId: null | ||
}, | ||
{ | ||
id: 's-ynryernd0xw1', | ||
name: 'SHAM - Test 2-1', | ||
parentId: 's-2xdq7wwd620l' | ||
}, | ||
{ | ||
id: 's-gm3evxqwzzmj', | ||
name: 'PROD-8311', | ||
parentId: 's-1v9g5kzkv6o3' | ||
}, | ||
{ | ||
id: 's-0nlpdyr305o3', | ||
name: 'PROD-8109', | ||
parentId: 's-1v9g5kzkv6o3' | ||
}, | ||
{ | ||
id: 's-2xmgyyynzjv8', | ||
name: 'VMI - Test metrics', | ||
parentId: 's-1v9g5kzkv6o3' | ||
}, | ||
{ | ||
id: 's-82y5ew9216rl', | ||
name: 'THU - Test 2', | ||
parentId: 's-5lx5zk9k6zgw' | ||
}, | ||
{ | ||
id: 's-52q26jd8w0n3', | ||
name: 'NBO - test efgh', | ||
parentId: 's-q4v57lx22dm4' | ||
}, | ||
{ | ||
id: 's-9zqz7m3p2gg5', | ||
name: 'NBO - test abbcd', | ||
parentId: 's-q4v57lx22dm4' | ||
}, | ||
{ | ||
id: 's-7rqr96eyvkx9', | ||
name: 'NBO - test lmnop', | ||
parentId: 's-q4v57lx22dm4' | ||
}, | ||
{ | ||
id: 's-9zqq2p36vrp1', | ||
name: 'NBO - test abc3', | ||
parentId: 's-q4v57lx22dm4' | ||
}, | ||
{ | ||
id: 's-5mqqk55n239z', | ||
name: 'NBO - abc2', | ||
parentId: 's-9zqz7m3p2gg5' | ||
}, | ||
{ | ||
id: 's-gk111e3v47mm', | ||
name: 'NBO - test abc0', | ||
parentId: 's-52q26jd8w0n3' | ||
} | ||
]; | ||
|
||
export const expectedSortedScenariolist = [ | ||
{ | ||
id: 's-p7xypk75kdyk', | ||
name: 'JREY - Test refresh parameters', | ||
parentId: null, | ||
depth: 0 | ||
}, | ||
{ | ||
id: 's-q4v57lx22dm4', | ||
name: 'NBO - test abc1', | ||
parentId: null, | ||
depth: 0 | ||
}, | ||
{ | ||
id: 's-9zqz7m3p2gg5', | ||
name: 'NBO - test abbcd', | ||
parentId: 's-q4v57lx22dm4', | ||
depth: 1 | ||
}, | ||
{ | ||
id: 's-5mqqk55n239z', | ||
name: 'NBO - abc2', | ||
parentId: 's-9zqz7m3p2gg5', | ||
depth: 2 | ||
}, | ||
{ | ||
id: 's-9zqq2p36vrp1', | ||
name: 'NBO - test abc3', | ||
parentId: 's-q4v57lx22dm4', | ||
depth: 1 | ||
}, | ||
{ | ||
id: 's-52q26jd8w0n3', | ||
name: 'NBO - test efgh', | ||
parentId: 's-q4v57lx22dm4', | ||
depth: 1 | ||
}, | ||
{ | ||
id: 's-gk111e3v47mm', | ||
name: 'NBO - test abc0', | ||
parentId: 's-52q26jd8w0n3', | ||
depth: 2 | ||
}, | ||
{ | ||
id: 's-7rqr96eyvkx9', | ||
name: 'NBO - test lmnop', | ||
parentId: 's-q4v57lx22dm4', | ||
depth: 1 | ||
}, | ||
{ | ||
id: 's-1v9g5kzkv6o3', | ||
name: 'PROD-8310', | ||
parentId: null, | ||
depth: 0 | ||
}, | ||
{ | ||
id: 's-0nlpdyr305o3', | ||
name: 'PROD-8109', | ||
parentId: 's-1v9g5kzkv6o3', | ||
depth: 1 | ||
}, | ||
{ | ||
id: 's-gm3evxqwzzmj', | ||
name: 'PROD-8311', | ||
parentId: 's-1v9g5kzkv6o3', | ||
depth: 1 | ||
}, | ||
{ | ||
id: 's-2xmgyyynzjv8', | ||
name: 'VMI - Test metrics', | ||
parentId: 's-1v9g5kzkv6o3', | ||
depth: 1 | ||
}, | ||
{ | ||
id: 's-nn4le5eq42v6', | ||
name: 'SHAM - Test 1', | ||
parentId: null, | ||
depth: 0 | ||
}, | ||
{ | ||
id: 's-2xdq7wwd620l', | ||
name: 'SHAM - Test 2', | ||
parentId: null, | ||
depth: 0 | ||
}, | ||
{ | ||
id: 's-ynryernd0xw1', | ||
name: 'SHAM - Test 2-1', | ||
parentId: 's-2xdq7wwd620l', | ||
depth: 1 | ||
}, | ||
{ | ||
id: 's-0n1r7pqwpd9g', | ||
name: 'SHAM - Test 3', | ||
parentId: null, | ||
depth: 0 | ||
}, | ||
{ | ||
id: 's-j8wkvnn803zp', | ||
name: 'SHAM - Test 6', | ||
parentId: null, | ||
depth: 0 | ||
}, | ||
{ | ||
id: 's-onr272m71o0z', | ||
name: 'SHAM Test 5', | ||
parentId: null, | ||
depth: 0 | ||
}, | ||
{ | ||
id: 's-5lx5zk9k6zgw', | ||
name: 'THU - Test', | ||
parentId: null, | ||
depth: 0 | ||
}, | ||
{ | ||
id: 's-82y5ew9216rl', | ||
name: 'THU - Test 2', | ||
parentId: 's-5lx5zk9k6zgw', | ||
depth: 1 | ||
} | ||
]; |
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,17 @@ | ||
// Copyright (c) Cosmo Tech. | ||
// Licensed under the MIT license. | ||
|
||
import { scenarioList, expectedSortedScenariolist } from './ScenarioListData.js'; | ||
import { sortScenarioList } from '../SortScenarioListUtils'; | ||
|
||
describe('sortScenarioList', () => { | ||
test('sort scenario list with right depth with an unsorted list', () => { | ||
const sortedScenarioList = sortScenarioList(scenarioList); | ||
expect(sortedScenarioList).toStrictEqual(expectedSortedScenariolist); | ||
}); | ||
|
||
test('sort scenario list function with empty list', () => { | ||
const sortedScenarioList = sortScenarioList([]); | ||
expect(sortedScenarioList).toStrictEqual([]); | ||
}); | ||
}); |