-
Notifications
You must be signed in to change notification settings - Fork 74
Wizard/Packages: Sort packages by the newest added (HMS-10767) #4719
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,9 +63,9 @@ describe('content reducers', () => { | |
|
|
||
| expect(state.content.packages).toHaveLength(3); | ||
| expect(state.content.packages.map((p) => p.name)).toEqual([ | ||
| 'vim', | ||
| 'git', | ||
| 'curl', | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (testing): Add corresponding tests for The expectations for Please add reducer tests for |
||
| 'git', | ||
| 'vim', | ||
| ]); | ||
| }); | ||
|
|
||
|
|
@@ -255,6 +255,25 @@ describe('content reducers', () => { | |
| expect(result.content.groups[0].name).toBe('Development Tools'); | ||
| }); | ||
|
|
||
| it('should insert new groups at the beginning', () => { | ||
| let state = wizardReducer( | ||
| initialState, | ||
| addPackageGroup(createGroup('Development Tools')), | ||
| ); | ||
| state = wizardReducer(state, addPackageGroup(createGroup('Server'))); | ||
| state = wizardReducer( | ||
| state, | ||
| addPackageGroup(createGroup('Networking')), | ||
| ); | ||
|
|
||
| expect(state.content.groups).toHaveLength(3); | ||
| expect(state.content.groups.map((g) => g.name)).toEqual([ | ||
| 'Networking', | ||
| 'Server', | ||
| 'Development Tools', | ||
| ]); | ||
| }); | ||
|
|
||
| it('should update existing group if same name', () => { | ||
| const stateWithGroup: WizardState = { | ||
| ...initialState, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same sorting logic remains in
PackageSearchwhere it still makes sense. In the case of packages table, there is no reason to sort the rows by stream, end date, etc. and thus adding the packages to the selected packages table in seemingly random places.