-
Notifications
You must be signed in to change notification settings - Fork 12
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
Wire-Filter e2e #648
Wire-Filter e2e #648
Conversation
import {setup, addDefaultResources, addResources, addAllWireItems} from '../../support/e2e'; | ||
import {NewshubLayout} from '../../support/pages/layout'; | ||
|
||
export const WIRE_ITEMS = { |
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.
are those any different to those ?
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.
yep... in created date...
@@ -5,7 +5,7 @@ export default function FilterItem({bucket, group, toggleFilter, groupFilter}: a | |||
const isActive = groupFilter.indexOf(bucket.key) !== -1; | |||
|
|||
return ( | |||
<div className="form-check"> | |||
<div className="form-check" data-test-id="checkbox" data-test-value={bucket.key}> |
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.
not sure if we need that, is checkbox
really an id if it's used many times?
something like
data-test-id={`filter-${bucket.key}`}
might be better
/** | ||
SEARCH | ||
*/ | ||
cy.get('[data-test-id="sidenav-link-wire"]').click(); |
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.
would be good to extend the wire page helper and add methods like:
wirePage.openSideNav();
wirePage.search('Sydney');
this would make it more readable in general
|
||
cy.url().should('include', 'Sydney'); | ||
|
||
cy.get(`[data-test-id="wire-item"][data-test-value="${WIRE_ITEMS.syd_weather_1._id}"]`).should('exist'); | ||
cy.get(`[data-test-id="wire-item"][data-test-value="${WIRE_ITEMS.bris_traffic_1._id}"]`).should('not.exist'); | ||
cy.get(`[data-test-id="wire-item"][data-test-value="${WireItems.item_1._id}"]`).should('exist'); |
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.
you could also make a helper for this like WirePage.item(WireItems.item_1).should('exist');
NHUB-433