Skip to Main Content
Modern Front-End Development for Rails, 2nd Edition
book

Modern Front-End Development for Rails, 2nd Edition

by Noel Rappin
September 2022
Intermediate to advanced content levelIntermediate to advanced
410 pages
10h 7m
English
Pragmatic Bookshelf
Content preview from Modern Front-End Development for Rails, 2nd Edition

Testing the Schedule Filter

Let’s write more examples in Cypress that cover at least some of the other features we’ve written in Stimulus and React. Here’s a longer series of tests that deals with the calendar filter at the top of the schedule page. The behavior we’re checking here is to confirm that clicking on a calendar item makes only concerts with that date visible and that clicking back to a state of no clicks makes everything visible again.

Here’s the code:

 describe(​"calendar filters"​, () => {
  beforeEach(() => {
  cy.visit(​"/"​)
  cy.​get​(​"#calendar-day-2022-04-11"​).first().​as​(​"dayOne"​)
  cy.​get​(​"#calendar-day-2022-04-12"​).first().​as​(​"dayTwo"​)
  cy.​get​(​ ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Modern Front-End Development for Rails

Modern Front-End Development for Rails

Noel Rappin

Publisher Resources

ISBN: 9781680509977Errata Page