2023-05-22 19:02:54 +03:00
|
|
|
import { getTestSelector } from '../../utils'
|
|
|
|
|
|
|
|
describe('Swap settings', () => {
|
|
|
|
it('Opens and closes the settings menu', () => {
|
2023-08-30 23:08:18 +03:00
|
|
|
cy.visit('/swap')
|
2023-05-22 19:02:54 +03:00
|
|
|
cy.contains('Settings').should('not.exist')
|
|
|
|
cy.get(getTestSelector('open-settings-dialog-button')).click()
|
2023-08-10 19:20:31 +03:00
|
|
|
cy.get(getTestSelector('mobile-settings-menu')).should('not.exist')
|
2023-10-05 22:34:23 +03:00
|
|
|
cy.contains('Max. slippage').should('exist')
|
2023-05-22 19:02:54 +03:00
|
|
|
cy.contains('Transaction deadline').should('exist')
|
2023-07-15 00:46:59 +03:00
|
|
|
cy.contains('UniswapX').should('exist')
|
2023-05-22 19:02:54 +03:00
|
|
|
cy.get(getTestSelector('open-settings-dialog-button')).click()
|
|
|
|
cy.contains('Settings').should('not.exist')
|
|
|
|
})
|
2023-08-10 19:20:31 +03:00
|
|
|
|
|
|
|
it('should open the mobile settings menu', () => {
|
2023-09-07 01:52:47 +03:00
|
|
|
// Set viewport to iPhone 6
|
2023-08-10 19:20:31 +03:00
|
|
|
cy.viewport('iphone-6')
|
2023-08-30 23:08:18 +03:00
|
|
|
cy.visit('/swap')
|
2023-09-07 01:52:47 +03: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 22:34:23 +03:00
|
|
|
cy.contains('Max. slippage').should('exist')
|
2023-09-07 01:52:47 +03:00
|
|
|
cy.contains('UniswapX').should('exist')
|
|
|
|
cy.contains('Transaction deadline').should('exist')
|
|
|
|
cy.get(getTestSelector('mobile-settings-close')).click()
|
|
|
|
})
|
2023-08-10 19:20:31 +03:00
|
|
|
})
|
2023-05-22 19:02:54 +03:00
|
|
|
})
|