-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Dashboard one column mode test #3621
Conversation
@arikfr any other aspect to test with this feature? |
I'll add some controls hide/show testing |
72a27f4
to
8886481
Compare
18722ee
to
326654d
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.
More tests 🙂.
I left some comments, requesting changes more to the ones with assertions that don't work ^^
b96ebe6
to
104783e
Compare
@@ -629,4 +629,69 @@ describe('Dashboard', () => { | |||
}); | |||
}); | |||
}); | |||
|
|||
context('viewport width is at 800px', () => { |
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.
With context
how about moving cy.viewport(800, 800);
to its beforeEach
hook?
You'll have to invert tests order so the assertion for one column mode comes first, but it seems to make sense:
context('viewport width is at 800px', () => {
beforeEach(function () {
cy.visit(this.dashboardUrl);
cy.viewport(800, 800);
});
it('shows widgets with full width', () => {
cy.get('@textboxEl').should(($el) => {
expect($el.width()).to.eq(785);
});
cy.viewport(801, 800);
cy.get('@textboxEl').should(($el) => {
expect($el.width()).to.eq(393);
});
});
});
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.
@gabrieldutra I went for this, wdyt?
describe('Viewport width affects presentation', () => {
context('viewport width is at 800px', () => {
it('shows widgets with full width' ...
it('hides edit option' ...
it('disables edit mode' ...
});
context('viewport width is above 800px', () => {
it('shows widgets with specified width' ...
it('shows edit option' ...
it('enables edit mode' ...
});
context('viewport width is at 767px', () => {
it('hides menu button' ...
});
context('viewport width is above 767px', () => {
it('shows menu button' ...
});
});
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 would say this would be the state-of-the-art
when considering tests organization. However, Cypress has a cost associated to each new it
block, so it's worth it to check how much will be added after this.
From this point whatever you want is good to me, so LMK when I can check it again 🙂
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.
@ranbena Just a note about these tests: does it make any sense to split
WDYT? |
@kravets-levko yes, now that tests are done (for now 😅) I'll split it into 3 files, in a followup PR. |
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 use a VM for development with 8GB RAM... I should add some memory to VM
It's sort of fun to see you say it, because 8GB RAM is all I've got to my laptop now 😆. Eventually I'm gonna upgrade it, but I didn't see a need so far. I'm not sure how you managed to have issues with it, but I can usually run Cypress tests with 4 GB available (the rest already used by Chrome and other apps).
I agree we should split it anyway in a following PR.
@@ -629,4 +629,69 @@ describe('Dashboard', () => { | |||
}); | |||
}); | |||
}); | |||
|
|||
context('viewport width is at 800px', () => { |
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 would say this would be the state-of-the-art
when considering tests organization. However, Cypress has a cost associated to each new it
block, so it's worth it to check how much will be added after this.
From this point whatever you want is good to me, so LMK when I can check it again 🙂
Co-Authored-By: ranbena <[email protected]>
Co-Authored-By: ranbena <[email protected]>
Co-Authored-By: ranbena <[email protected]>
Co-Authored-By: ranbena <[email protected]>
Co-Authored-By: ranbena <[email protected]>
Co-Authored-By: ranbena <[email protected]>
Co-Authored-By: ranbena <[email protected]>
104783e
to
215860e
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.
Looks nice! ☕
Co-Authored-By: ranbena <[email protected]>
What type of PR is this?
Description