Commit 1cfb3d80 authored by Vignesh Mohankumar's avatar Vignesh Mohankumar Committed by GitHub

feat: release new landing page (#5596)

* feat: release new landing page

* fix wallet dropdown integration tests

* remove problematic/not useful tests
Co-authored-by: default avatarJordan Frankfurt <jordanwfrankfurt@gmail.com>
parent a650807c
...@@ -3,7 +3,7 @@ import { defineConfig } from 'cypress' ...@@ -3,7 +3,7 @@ import { defineConfig } from 'cypress'
export default defineConfig({ export default defineConfig({
projectId: 'yp82ef', projectId: 'yp82ef',
videoUploadOnPasses: false, videoUploadOnPasses: false,
defaultCommandTimeout: 24000, // 2x average block time defaultCommandTimeout: 4000, // 2x average block time
chromeWebSecurity: false, chromeWebSecurity: false,
e2e: { e2e: {
setupNodeEvents(on, config) { setupNodeEvents(on, config) {
......
...@@ -5,10 +5,6 @@ describe('Landing Page', () => { ...@@ -5,10 +5,6 @@ describe('Landing Page', () => {
cy.screenshot() cy.screenshot()
}) })
it('redirects to url /swap', () => {
cy.url().should('include', '/swap')
})
it('allows navigation to pool', () => { it('allows navigation to pool', () => {
cy.get('#pool-nav-link').click() cy.get('#pool-nav-link').click()
cy.url().should('include', '/pool') cy.url().should('include', '/pool')
......
...@@ -22,10 +22,4 @@ describe('Remove Liquidity', () => { ...@@ -22,10 +22,4 @@ describe('Remove Liquidity', () => {
cy.get('#remove-liquidity-tokena-symbol').should('contain.text', 'WETH') cy.get('#remove-liquidity-tokena-symbol').should('contain.text', 'WETH')
cy.get('#remove-liquidity-tokenb-symbol').should('contain.text', 'WETH') cy.get('#remove-liquidity-tokenb-symbol').should('contain.text', 'WETH')
}) })
it.skip('token not in storage is loaded', () => {
cy.visit('/remove/v2/0xb290b2f9f8f108d03ff2af3ac5c8de6de31cdf6d/0xF9bA5210F91D0474bd1e1DcDAeC4C58E359AaD85')
cy.get('#remove-liquidity-tokena-symbol').should('contain.text', 'SKL')
cy.get('#remove-liquidity-tokenb-symbol').should('contain.text', 'MKR')
})
}) })
import { getTestSelector } from '../utils' import { getTestSelector } from '../utils'
describe('Wallet Dropdown', () => { describe('Wallet Dropdown', () => {
before(() => { beforeEach(() => {
cy.visit('/') cy.visit('/pool')
}) })
it('should change the theme', () => { it('should change the theme', () => {
...@@ -12,6 +12,7 @@ describe('Wallet Dropdown', () => { ...@@ -12,6 +12,7 @@ describe('Wallet Dropdown', () => {
}) })
it('should select a language', () => { it('should select a language', () => {
cy.get(getTestSelector('web3-status-connected')).click()
cy.get(getTestSelector('wallet-select-language')).click() cy.get(getTestSelector('wallet-select-language')).click()
cy.get(getTestSelector('wallet-language-item')).contains('Afrikaans').click({ force: true }) cy.get(getTestSelector('wallet-language-item')).contains('Afrikaans').click({ force: true })
cy.get(getTestSelector('wallet-header')).should('contain', 'Taal') cy.get(getTestSelector('wallet-header')).should('contain', 'Taal')
...@@ -21,18 +22,24 @@ describe('Wallet Dropdown', () => { ...@@ -21,18 +22,24 @@ describe('Wallet Dropdown', () => {
}) })
it('should be able to view transactions', () => { it('should be able to view transactions', () => {
cy.get(getTestSelector('web3-status-connected')).click()
cy.get(getTestSelector('wallet-transactions')).click() cy.get(getTestSelector('wallet-transactions')).click()
cy.get(getTestSelector('wallet-empty-transaction-text')).should('exist') cy.get(getTestSelector('wallet-empty-transaction-text')).should('exist')
cy.get(getTestSelector('wallet-back')).click() cy.get(getTestSelector('wallet-back')).click()
}) })
it('should change the theme when not connected', () => { it('should change the theme when not connected', () => {
cy.get(getTestSelector('web3-status-connected')).click()
cy.get(getTestSelector('wallet-disconnect')).click() cy.get(getTestSelector('wallet-disconnect')).click()
cy.get(getTestSelector('wallet-select-theme')).click() cy.get(getTestSelector('wallet-select-theme')).click()
cy.get(getTestSelector('wallet-select-theme')).contains('Light theme').should('exist')
cy.get(getTestSelector('wallet-select-theme')).click()
cy.get(getTestSelector('wallet-select-theme')).contains('Dark theme').should('exist') cy.get(getTestSelector('wallet-select-theme')).contains('Dark theme').should('exist')
}) })
it('should select a language when not connected', () => { it('should select a language when not connected', () => {
cy.get(getTestSelector('web3-status-connected')).click()
cy.get(getTestSelector('wallet-disconnect')).click()
cy.get(getTestSelector('wallet-select-language')).click() cy.get(getTestSelector('wallet-select-language')).click()
cy.get(getTestSelector('wallet-language-item')).contains('Afrikaans').click({ force: true }) cy.get(getTestSelector('wallet-language-item')).contains('Afrikaans').click({ force: true })
cy.get(getTestSelector('wallet-header')).should('contain', 'Taal') cy.get(getTestSelector('wallet-header')).should('contain', 'Taal')
...@@ -42,6 +49,8 @@ describe('Wallet Dropdown', () => { ...@@ -42,6 +49,8 @@ describe('Wallet Dropdown', () => {
}) })
it('should open the wallet connect modal from the drop down when not connected', () => { it('should open the wallet connect modal from the drop down when not connected', () => {
cy.get(getTestSelector('web3-status-connected')).click()
cy.get(getTestSelector('wallet-disconnect')).click()
cy.get(getTestSelector('wallet-connect-wallet')).click() cy.get(getTestSelector('wallet-connect-wallet')).click()
cy.get(getTestSelector('wallet-modal')).should('exist') cy.get(getTestSelector('wallet-modal')).should('exist')
cy.get(getTestSelector('wallet-modal-close')).click() cy.get(getTestSelector('wallet-modal-close')).click()
......
...@@ -52,7 +52,6 @@ const WalletDropdownWrapper = styled.div` ...@@ -52,7 +52,6 @@ const WalletDropdownWrapper = styled.div`
const WalletDropdown = () => { const WalletDropdown = () => {
const [menu, setMenu] = useState<MenuState>(MenuState.DEFAULT) const [menu, setMenu] = useState<MenuState>(MenuState.DEFAULT)
const walletDropdownOpen = useModalIsOpen(ApplicationModal.WALLET_DROPDOWN) const walletDropdownOpen = useModalIsOpen(ApplicationModal.WALLET_DROPDOWN)
return ( return (
<> <>
{walletDropdownOpen && ( {walletDropdownOpen && (
......
...@@ -281,7 +281,7 @@ function Web3StatusInner() { ...@@ -281,7 +281,7 @@ function Web3StatusInner() {
<Trans>Connect</Trans> <Trans>Connect</Trans>
</StyledConnectButton> </StyledConnectButton>
<VerticalDivider /> <VerticalDivider />
<ChevronWrapper onClick={toggleWalletDropdown}> <ChevronWrapper onClick={toggleWalletDropdown} data-testid="navbar-toggle-dropdown">
{walletIsOpen ? <ChevronUp {...chevronProps} /> : <ChevronDown {...chevronProps} />} {walletIsOpen ? <ChevronUp {...chevronProps} /> : <ChevronDown {...chevronProps} />}
</ChevronWrapper> </ChevronWrapper>
</Web3StatusConnectWrapper> </Web3StatusConnectWrapper>
......
import { BaseVariant, FeatureFlag, useBaseFlag } from '../index' import { BaseVariant } from '../index'
export function useLandingPageFlag(): BaseVariant { export function useLandingPageFlag(): BaseVariant {
return useBaseFlag(FeatureFlag.landingPage) return BaseVariant.Enabled
} }
export { BaseVariant as LandingPageVariant } export { BaseVariant as LandingPageVariant }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment