-
Notifications
You must be signed in to change notification settings - Fork 27
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
Toolbar play from stopped #806
Conversation
Codecov Report
@@ Coverage Diff @@
## master #806 +/- ##
==========================================
- Coverage 91.69% 91.43% -0.27%
==========================================
Files 86 86
Lines 1686 1693 +7
Branches 105 108 +3
==========================================
+ Hits 1546 1548 +2
- Misses 117 120 +3
- Partials 23 25 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
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.
Looks good to me, pending only a test for the new methods added in the components 😬 unit tests can be used to access those properties, see:
- The mount function that creates components with access to Vuetify, Vuex, etc, and where you can also provide stubs/mocks:
cylc-ui/tests/unit/components/cylc/gscan/gscan.vue.spec.js
Lines 72 to 83 in a3005b0
const mountFunction = options => { const vuetify = new Vuetify() return mount(GScan, { localVue, vuetify, store, stubs: { RouterLink: RouterLinkStub }, ...options }) } - The tests before/after callbacks in case you need to reset state before/after each test:
cylc-ui/tests/unit/components/cylc/gscan/gscan.vue.spec.js
Lines 62 to 67 in a3005b0
const resetState = () => { store.commit('workflows/SET_WORKFLOWS', []) store.commit('workflows/SET_WORKFLOW_NAME', null) } beforeEach(resetState) afterEach(resetState) - Calling the mount function, passing component options, which can include
computed
,propsOptions
, etc:cylc-ui/tests/unit/components/cylc/gscan/gscan.vue.spec.js
Lines 85 to 91 in a3005b0
const wrapper = mountFunction({ computed: { isLoading () { return true } } }) - Accessing DOM attributes of the mounted component:
const skeletonLoader = wrapper.find('.v-skeleton-loader') - Accessing Vue.js properties (from props/data/computed/etc):
expect(wrapper.vm.workflows[0].name).to.equal('five')
With that we should be able to create a small test copying the existing code that mounts the component, and gives it the necessary state for the play/stop/pause toggle.
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.
This PR looks great. I understand there are tests to do and this is not maybe ready for final review. I have checked this out (in preparation for disabling unauthorised buttons) and have some observations, I think they are all appropriate to do in different PRs.
- If I create a new workflow folder, this_is_new, when picked up and selected in the ui, the stop button is correctly shown and play button enabled:
However, if I select some existing workflows they have play disabled.
If we want this to behave in the same way for all "Not yet run" workflows, does this need a dependency on this state? - The icon for "Not yet run" on the left panel is the same as stopped, I think this was part of the built on pr.
- The stop and pause are disabled on stopping but still visible in mutation menu.
This should work for "not yet run" workflows. The dependent cylc-flow and cylc-uiserver PRs have only just been merged so it might take a |
81e0280
to
8885afc
Compare
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.
Code looks good to me. Worth a quick test @AaronDCole , and not sure if we already have tests or if we need some unit/e2e tests. You'll inherit this one @AaronDCole 😬
Testing this sort of thing without live data is going to be a bit tricky/limited, can have a go, will take a look next week. Long term I think a system integration test suite for cylc-flow, cylc-uiserver and cylc-ui with Cypress might be a good way to go. Would be good to slide this into the beta if possible so may need to go on manual testing for now and bump to an issue. |
Does this close #748? |
* This completes the play-pause/resume-stop sequence in the workflow toolbar.
8885afc
to
d9960a4
Compare
Rebased, added changelog. |
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.
LGTM
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.
I have checked out the branch and tested the change. Looks great, thanks @oliver-sanders.
The change is not covered by a test, like you said it is a hard one to test and I'm not quite sure how I would go about it so I am merging having manually tested, I could open an issue for the testing if you think it would be fitting?
I think we have an issue on cylc-admin for system testing. My best idea ATM is to use Cypress to test the UI but using live data provided by a UIS. |
built on #805
This completes the play-pause/resume-stop sequence in the workflow toolbar.
Requirements check-list
CONTRIBUTING.md
and added my name as a Code Contributor.