2023-05-22 09:02:54 -07:00
|
|
|
import { getTestSelector } from '../../utils'
|
|
|
|
|
|
|
|
describe('Swap settings', () => {
|
|
|
|
it('Opens and closes the settings menu', () => {
|
2023-08-30 13:08:18 -07:00
|
|
|
cy.visit('/swap')
|
2023-05-22 09:02:54 -07:00
|
|
|
cy.contains('Settings').should('not.exist')
|
|
|
|
cy.get(getTestSelector('open-settings-dialog-button')).click()
|
2023-08-10 12:20:31 -04:00
|
|
|
cy.get(getTestSelector('mobile-settings-menu')).should('not.exist')
|
2023-10-05 15:34:23 -04:00
|
|
|
cy.contains('Max. slippage').should('exist')
|
2023-05-22 09:02:54 -07:00
|
|
|
cy.contains('Transaction deadline').should('exist')
|
2023-07-14 23:46:59 +02:00
|
|
|
cy.contains('UniswapX').should('exist')
|
2023-05-22 09:02:54 -07:00
|
|
|
cy.get(getTestSelector('open-settings-dialog-button')).click()
|
|
|
|
cy.contains('Settings').should('not.exist')
|
|
|
|
})
|
2023-08-10 12:20:31 -04:00
|
|
|
|
|
|
|
it('should open the mobile settings menu', () => {
|
2023-09-06 17:52:47 -05:00
|
|
|
// Set viewport to iPhone 6
|
2023-08-10 12:20:31 -04:00
|
|
|
cy.viewport('iphone-6')
|
2023-08-30 13:08:18 -07:00
|
|
|
cy.visit('/swap')
|
2023-09-06 17:52:47 -05:00
|
|
|
|
|
|
|
// Click the button to open the settings dialog
|
|
|
|
cy.get(getTestSelector('open-settings-dialog-button')).click({ waitForAnimations: true })
|
|
|
|
|
|
|
|
// Verify the mobile settings menu and its contents
|
|
|
|
cy.get(getTestSelector('mobile-settings-menu'))
|
|
|
|
.should('exist')
|
|
|
|
.within(() => {
|
2023-10-05 15:34:23 -04:00
|
|
|
cy.contains('Max. slippage').should('exist')
|
2023-09-06 17:52:47 -05:00
|
|
|
cy.contains('UniswapX').should('exist')
|
|
|
|
cy.contains('Transaction deadline').should('exist')
|
|
|
|
cy.get(getTestSelector('mobile-settings-close')).click()
|
|
|
|
})
|
2023-08-10 12:20:31 -04:00
|
|
|
})
|
2023-05-22 09:02:54 -07:00
|
|
|
})
|