-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
990806 refactor & bug fixes & write test
- Loading branch information
1 parent
4f18335
commit acc70f3
Showing
5 changed files
with
115 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/// <reference types="Cypress" /> | ||
|
||
describe('select date range', () => { | ||
beforeEach(() => { | ||
cy.changeProps('from', undefined) | ||
cy.changeProps('to', undefined) | ||
cy.changeSlots() | ||
}) | ||
|
||
it('today button', () => { | ||
cy.visit('/') | ||
cy.get('.pdp-input').focus() | ||
cy.get('.pdp-today').click() | ||
cy.get('.pdp-day.today').should('have.class', 'tada') | ||
}) | ||
|
||
it('show top of input', async () => { | ||
await cy.visit('/') | ||
await cy.get('.pdp').invoke('attr', 'style', 'margin-top:50rem;') | ||
await cy.get('.pdp-input').focus() | ||
await cy.wait(1000) | ||
let pickerTop = await cy.$$('.pdp-picker').offset().top; | ||
let inputTop = await cy.$$('.pdp-input').offset().top; | ||
expect(pickerTop).lt(inputTop) | ||
}) | ||
|
||
it('scroll in year-select section', async () => { | ||
await cy.visit('/') | ||
await cy.get('.pdp-input').focus() | ||
await cy.get('.pdp-year').first().click() | ||
await cy.wait(1000) | ||
await expect(cy.$$('.pdp-select-year').offset().top).not.equal(0) | ||
}) | ||
|
||
|
||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.