Commit c3f12398 authored by Moody Salem's avatar Moody Salem Committed by GitHub

fix: reverts the defaulting behavior of 1 eth to usdc (#3465)

parent 2272f2a0
...@@ -3,11 +3,11 @@ describe('Swap', () => { ...@@ -3,11 +3,11 @@ describe('Swap', () => {
cy.visit('/swap') cy.visit('/swap')
}) })
it('starts with an ETH/USDC swap and quotes it', () => { it('starts with ETH selected by default', () => {
cy.get('#swap-currency-input .token-amount-input').should('have.value', '1') cy.get('#swap-currency-input .token-amount-input').should('have.value', '')
cy.get('#swap-currency-input .token-symbol-container').should('contain.text', 'ETH') cy.get('#swap-currency-input .token-symbol-container').should('contain.text', 'ETH')
cy.get('#swap-currency-output .token-amount-input').should('not.have.value', '') cy.get('#swap-currency-output .token-amount-input').should('not.have.value')
cy.get('#swap-currency-output .token-symbol-container').should('contain.text', 'USDC') cy.get('#swap-currency-output .token-symbol-container').should('contain.text', 'Select a token')
}) })
it('can enter an amount into input', () => { it('can enter an amount into input', () => {
......
...@@ -27,8 +27,8 @@ describe('hooks', () => { ...@@ -27,8 +27,8 @@ describe('hooks', () => {
queryParametersToSwapState(parse('?outputCurrency=invalid', { parseArrays: false, ignoreQueryPrefix: true })) queryParametersToSwapState(parse('?outputCurrency=invalid', { parseArrays: false, ignoreQueryPrefix: true }))
).toEqual({ ).toEqual({
[Field.INPUT]: { currencyId: 'ETH' }, [Field.INPUT]: { currencyId: 'ETH' },
[Field.OUTPUT]: { currencyId: 'USDC' }, [Field.OUTPUT]: { currencyId: null },
typedValue: '1', typedValue: '',
independentField: Field.INPUT, independentField: Field.INPUT,
recipient: null, recipient: null,
}) })
......
...@@ -219,14 +219,12 @@ function validatedRecipient(recipient: any): string | null { ...@@ -219,14 +219,12 @@ function validatedRecipient(recipient: any): string | null {
export function queryParametersToSwapState(parsedQs: ParsedQs): SwapState { export function queryParametersToSwapState(parsedQs: ParsedQs): SwapState {
let inputCurrency = parseCurrencyFromURLParameter(parsedQs.inputCurrency) let inputCurrency = parseCurrencyFromURLParameter(parsedQs.inputCurrency)
let outputCurrency = parseCurrencyFromURLParameter(parsedQs.outputCurrency) let outputCurrency = parseCurrencyFromURLParameter(parsedQs.outputCurrency)
let typedValue = parseTokenAmountURLParameter(parsedQs.exactAmount) const typedValue = parseTokenAmountURLParameter(parsedQs.exactAmount)
const independentField = parseIndependentFieldURLParameter(parsedQs.exactField) const independentField = parseIndependentFieldURLParameter(parsedQs.exactField)
if (inputCurrency === '' && outputCurrency === '' && typedValue === '' && independentField === Field.INPUT) { if (inputCurrency === '' && outputCurrency === '' && typedValue === '' && independentField === Field.INPUT) {
// Defaults to 1 ETH -> USDC // Defaults to having the native currency selected
inputCurrency = 'ETH' inputCurrency = 'ETH'
outputCurrency = 'USDC'
typedValue = '1'
} else if (inputCurrency === outputCurrency) { } else if (inputCurrency === outputCurrency) {
// clear output if identical // clear output if identical
outputCurrency = '' outputCurrency = ''
......
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