Skip to content
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

sorting by kind and nested stories #3963

Merged
merged 5 commits into from
Aug 6, 2018
Merged

Conversation

dioxmio
Copy link
Contributor

@dioxmio dioxmio commented Aug 5, 2018

Issue:

What I did

sorting nested stories when activating: sortStoriesByKind: false

How to test

setOptions({sortStoriesByKind: false});

make sure that now both the root list of stories and the nested ones are ordered. At the moment just the root stories where sorted.

["bug", "maintenance"]
#3963

@codecov
Copy link

codecov bot commented Aug 5, 2018

Codecov Report

Merging #3963 into master will decrease coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3963      +/-   ##
==========================================
- Coverage   39.66%   39.63%   -0.03%     
==========================================
  Files         433      431       -2     
  Lines        5445     5444       -1     
  Branches      740      740              
==========================================
- Hits         2160     2158       -2     
  Misses       2903     2903              
- Partials      382      383       +1
Impacted Files Coverage Δ
lib/ui/src/modules/ui/libs/filters.js 100% <100%> (ø) ⬆️
lib/components/src/layout/desktop.js 69.64% <0%> (-3.58%) ⬇️
lib/components/src/icons/chevronRight.js
lib/components/src/icons/index.js

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e6f57bd...606a4f7. Read the comment docs.

@ndelangen
Copy link
Member

We should add some tests for this function

@dioxmio
Copy link
Contributor Author

dioxmio commented Aug 5, 2018

@ndelangen I'm getting this error:
Cannot find module '@storybook/addons' from 'index.js'
when running:
yarn run test --core --watch

any idea? I would create tests glady if can get this working :D

@ndelangen
Copy link
Member

@dioxmio There's lots of information in https://github.com/storybooks/storybook/blob/master/CONTRIBUTING.md

In short: you need to run yarn before running the unittests

@dioxmio
Copy link
Contributor Author

dioxmio commented Aug 5, 2018

@ndelangen awesome thanks. I have added the test however the build on Danger is failing. Looks like labels are missing but I'm not able to add any. Could you add that?

cheers

@ndelangen ndelangen added the bug label Aug 5, 2018
@@ -74,6 +74,20 @@ describe('manager.ui.libs.filters', () => {
expect(res).toEqual([stories[1], stories[2], stories[0]]);
});

test('should sort nested stories by kind', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of a test is a bit misleading, it should be something like "should sort nested stories", because terminologically it's not "by kind".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you changed a wrong test 🤣

@ndelangen
Copy link
Member

Sorry @igor-dv that should do it 😄

@ndelangen ndelangen merged commit 2a198f4 into storybookjs:master Aug 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants