aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorkumavis <aaron@kumavis.me>2019-03-29 11:54:12 +0800
committerkumavis <aaron@kumavis.me>2019-03-29 11:54:12 +0800
commit781a39c039500fcfe8fce3c3d75081ff781c4cf1 (patch)
tree5f7ba6db12b471ddd82e6be1d6e7dde0560d2cfd /test
parent07c974525859eba81471ec7591821ea010addf5a (diff)
parent649a1d483a574dcff902708f95b37329a02709a8 (diff)
downloadtangerine-wallet-browser-781a39c039500fcfe8fce3c3d75081ff781c4cf1.tar
tangerine-wallet-browser-781a39c039500fcfe8fce3c3d75081ff781c4cf1.tar.gz
tangerine-wallet-browser-781a39c039500fcfe8fce3c3d75081ff781c4cf1.tar.bz2
tangerine-wallet-browser-781a39c039500fcfe8fce3c3d75081ff781c4cf1.tar.lz
tangerine-wallet-browser-781a39c039500fcfe8fce3c3d75081ff781c4cf1.tar.xz
tangerine-wallet-browser-781a39c039500fcfe8fce3c3d75081ff781c4cf1.tar.zst
tangerine-wallet-browser-781a39c039500fcfe8fce3c3d75081ff781c4cf1.zip
Merge branch 'develop' into clearNotices
Diffstat (limited to 'test')
-rw-r--r--test/e2e/beta/metamask-beta-ui.spec.js18
-rw-r--r--test/unit/actions/config_test.js4
-rw-r--r--test/unit/actions/set_account_label_test.js4
-rw-r--r--test/unit/actions/set_selected_account_test.js4
-rw-r--r--test/unit/actions/tx_test.js2
-rw-r--r--test/unit/actions/view_info_test.js4
-rw-r--r--test/unit/actions/warning_test.js4
-rw-r--r--test/unit/app/buy-eth-url.spec.js11
-rw-r--r--test/unit/balance-formatter-test.js2
-rw-r--r--test/unit/reducers/unlock_vault_test.js4
-rw-r--r--test/unit/responsive/components/dropdown-test.js2
-rw-r--r--test/unit/ui/app/actions.spec.js2
-rw-r--r--test/unit/ui/app/components/token-cell.spec.js4
-rw-r--r--test/unit/ui/app/reducers/app.spec.js4
-rw-r--r--test/unit/ui/app/reducers/metamask.spec.js4
-rw-r--r--test/unit/ui/app/selectors.spec.js2
-rw-r--r--test/unit/util_test.js2
17 files changed, 39 insertions, 38 deletions
diff --git a/test/e2e/beta/metamask-beta-ui.spec.js b/test/e2e/beta/metamask-beta-ui.spec.js
index 06f67ad95..2700d1656 100644
--- a/test/e2e/beta/metamask-beta-ui.spec.js
+++ b/test/e2e/beta/metamask-beta-ui.spec.js
@@ -233,7 +233,11 @@ describe('MetaMask', function () {
await customRpcButton.click()
await delay(regularDelayMs)
- const privacyToggle = await findElement(driver, By.css('.settings-page__content-row:nth-of-type(10) .settings-page__content-item-col > div'))
+ const securityTab = await findElement(driver, By.xpath(`//div[contains(text(), 'Security & Privacy')]`))
+ await securityTab.click()
+ await delay(regularDelayMs)
+
+ const privacyToggle = await findElement(driver, By.css('.settings-page__content-row:nth-of-type(1) .settings-page__content-item-col > div'))
await privacyToggle.click()
await delay(largeDelayMs * 2)
})
@@ -472,15 +476,19 @@ describe('MetaMask', function () {
const settingsButton = await findElement(driver, By.xpath(`//div[contains(text(), 'Settings')]`))
settingsButton.click()
- await findElement(driver, By.css('.tab-bar'))
+ // await findElement(driver, By.css('.tab-bar'))
+
+ const advancedTab = await findElement(driver, By.xpath(`//div[contains(text(), 'Advanced')]`))
+ await advancedTab.click()
+ await delay(regularDelayMs)
- const showConversionToggle = await findElement(driver, By.css('.settings-page__content-row:nth-of-type(3) .settings-page__content-item-col > div'))
+ const showConversionToggle = await findElement(driver, By.css('.settings-page__content-row:nth-of-type(7) .settings-page__content-item-col > div'))
await showConversionToggle.click()
const advancedGasTitle = await findElement(driver, By.xpath(`//span[contains(text(), 'Advanced gas controls')]`))
await driver.executeScript('arguments[0].scrollIntoView(true)', advancedGasTitle)
- const advancedGasToggle = await findElement(driver, By.css('.settings-page__content-row:nth-of-type(12) .settings-page__content-item-col > div'))
+ const advancedGasToggle = await findElement(driver, By.css('.settings-page__content-row:nth-of-type(5) .settings-page__content-item-col > div'))
await advancedGasToggle.click()
windowHandles = await driver.getAllWindowHandles()
extension = windowHandles[0]
@@ -1053,7 +1061,6 @@ describe('MetaMask', function () {
const windowHandles = await driver.getAllWindowHandles()
const extension = windowHandles[0]
const dapp = await switchToWindowWithTitle(driver, 'E2E Test Dapp', windowHandles)
- await closeAllWindowHandlesExcept(driver, [extension, dapp])
await delay(regularDelayMs)
await driver.switchTo().window(dapp)
@@ -1062,7 +1069,6 @@ describe('MetaMask', function () {
const transferTokens = await findElement(driver, By.xpath(`//button[contains(text(), 'Transfer Tokens')]`))
await transferTokens.click()
- await closeAllWindowHandlesExcept(driver, [extension, dapp])
await driver.switchTo().window(extension)
await delay(largeDelayMs)
diff --git a/test/unit/actions/config_test.js b/test/unit/actions/config_test.js
index 648f456fb..9127474a8 100644
--- a/test/unit/actions/config_test.js
+++ b/test/unit/actions/config_test.js
@@ -3,8 +3,8 @@ var assert = require('assert')
var freeze = require('deep-freeze-strict')
var path = require('path')
-var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'actions.js'))
-var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'reducers.js'))
+var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'store', 'actions.js'))
+var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'ducks', 'index.js'))
describe('config view actions', function () {
var initialState = {
diff --git a/test/unit/actions/set_account_label_test.js b/test/unit/actions/set_account_label_test.js
index 53ea1d130..1601d6383 100644
--- a/test/unit/actions/set_account_label_test.js
+++ b/test/unit/actions/set_account_label_test.js
@@ -2,8 +2,8 @@ const assert = require('assert')
const freeze = require('deep-freeze-strict')
const path = require('path')
-const actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'actions.js'))
-const reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'reducers.js'))
+const actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'store', 'actions.js'))
+const reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'ducks', 'index.js'))
describe('SET_ACCOUNT_LABEL', function () {
it('updates the state.metamask.identities[:i].name property of the state to the action.value.label', function () {
diff --git a/test/unit/actions/set_selected_account_test.js b/test/unit/actions/set_selected_account_test.js
index 28b47d09d..36d312d7b 100644
--- a/test/unit/actions/set_selected_account_test.js
+++ b/test/unit/actions/set_selected_account_test.js
@@ -3,8 +3,8 @@ var assert = require('assert')
var freeze = require('deep-freeze-strict')
var path = require('path')
-var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'actions.js'))
-var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'reducers.js'))
+var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'store', 'actions.js'))
+var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'ducks', 'index.js'))
describe('SET_SELECTED_ACCOUNT', function () {
it('sets the state.appState.activeAddress property of the state to the action.value', function () {
diff --git a/test/unit/actions/tx_test.js b/test/unit/actions/tx_test.js
index 160cd4552..8c64d844f 100644
--- a/test/unit/actions/tx_test.js
+++ b/test/unit/actions/tx_test.js
@@ -4,7 +4,7 @@ var path = require('path')
import configureMockStore from 'redux-mock-store'
import thunk from 'redux-thunk'
-const actions = require(path.join(__dirname, '../../../ui/app/actions.js'))
+const actions = require(path.join(__dirname, '../../../ui/app/store/actions.js'))
const middlewares = [thunk]
const mockStore = configureMockStore(middlewares)
diff --git a/test/unit/actions/view_info_test.js b/test/unit/actions/view_info_test.js
index 69895d801..5785a368c 100644
--- a/test/unit/actions/view_info_test.js
+++ b/test/unit/actions/view_info_test.js
@@ -3,8 +3,8 @@ var assert = require('assert')
var freeze = require('deep-freeze-strict')
var path = require('path')
-var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'actions.js'))
-var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'reducers.js'))
+var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'store', 'actions.js'))
+var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'ducks', 'index.js'))
describe('SHOW_INFO_PAGE', function () {
it('sets the state.appState.currentView.name property to info', function () {
diff --git a/test/unit/actions/warning_test.js b/test/unit/actions/warning_test.js
index 28b565499..e57374cda 100644
--- a/test/unit/actions/warning_test.js
+++ b/test/unit/actions/warning_test.js
@@ -3,8 +3,8 @@ var assert = require('assert')
var freeze = require('deep-freeze-strict')
var path = require('path')
-var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'actions.js'))
-var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'reducers.js'))
+var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'store', 'actions.js'))
+var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'ducks', 'index.js'))
describe('action DISPLAY_WARNING', function () {
it('sets appState.warning to provided value', function () {
diff --git a/test/unit/app/buy-eth-url.spec.js b/test/unit/app/buy-eth-url.spec.js
index 36646fa68..6cf3e7d75 100644
--- a/test/unit/app/buy-eth-url.spec.js
+++ b/test/unit/app/buy-eth-url.spec.js
@@ -18,14 +18,9 @@ describe('', function () {
}
it('returns coinbase url with amount and address for network 1', function () {
- const coinbaseUrl = getBuyEthUrl(mainnet)
- const coinbase = coinbaseUrl.match(/(https:\/\/buy.coinbase.com)/)
- const amount = coinbaseUrl.match(/(amount)\D\d/)
- const address = coinbaseUrl.match(/(address)(.*)(?=&)/)
-
- assert.equal(coinbase[0], 'https://buy.coinbase.com')
- assert.equal(amount[0], 'amount=5')
- assert.equal(address[0], 'address=0x0dcd5d886577d5081b0c52e242ef29e70be3e7bc')
+ const wyreUrl = getBuyEthUrl(mainnet)
+
+ assert.equal(wyreUrl, 'https://dash.sendwyre.com/sign-up')
})
diff --git a/test/unit/balance-formatter-test.js b/test/unit/balance-formatter-test.js
index ab6daa19c..bd0eb5008 100644
--- a/test/unit/balance-formatter-test.js
+++ b/test/unit/balance-formatter-test.js
@@ -1,6 +1,6 @@
const assert = require('assert')
const currencyFormatter = require('currency-formatter')
-const infuraConversion = require('../../ui/app/infura-conversion.json')
+const infuraConversion = require('../../ui/app/helpers/constants/infura-conversion.json')
describe('currencyFormatting', function () {
it('be able to format any infura currency', function (done) {
diff --git a/test/unit/reducers/unlock_vault_test.js b/test/unit/reducers/unlock_vault_test.js
index d66e8edbb..d66891a63 100644
--- a/test/unit/reducers/unlock_vault_test.js
+++ b/test/unit/reducers/unlock_vault_test.js
@@ -4,8 +4,8 @@ var assert = require('assert')
var path = require('path')
var sinon = require('sinon')
-var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'actions.js'))
-var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'reducers.js'))
+var actions = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'store', 'actions.js'))
+var reducers = require(path.join(__dirname, '..', '..', '..', 'ui', 'app', 'ducks', 'index.js'))
describe('#unlockMetamask(selectedAccount)', function () {
beforeEach(function () {
diff --git a/test/unit/responsive/components/dropdown-test.js b/test/unit/responsive/components/dropdown-test.js
index f3f236d90..1fadbfb60 100644
--- a/test/unit/responsive/components/dropdown-test.js
+++ b/test/unit/responsive/components/dropdown-test.js
@@ -3,7 +3,7 @@ const assert = require('assert')
const h = require('react-hyperscript')
const sinon = require('sinon')
const path = require('path')
-const Dropdown = require(path.join(__dirname, '..', '..', '..', '..', 'ui', 'app', 'components', 'dropdowns', 'index.js')).Dropdown
+const Dropdown = require(path.join(__dirname, '..', '..', '..', '..', 'ui', 'app', 'components', 'app', 'dropdowns', 'index.js')).Dropdown
const { createMockStore } = require('redux-test-utils')
const { mountWithStore } = require('../../../lib/render-helpers')
diff --git a/test/unit/ui/app/actions.spec.js b/test/unit/ui/app/actions.spec.js
index bfc6459b1..d395c9adb 100644
--- a/test/unit/ui/app/actions.spec.js
+++ b/test/unit/ui/app/actions.spec.js
@@ -16,7 +16,7 @@ const { createTestProviderTools } = require('../../../stub/provider')
const provider = createTestProviderTools({ scaffold: {}}).provider
const enLocale = require('../../../../app/_locales/en/messages.json')
-const actions = require('../../../../ui/app/actions')
+const actions = require('../../../../ui/app/store/actions')
const MetaMaskController = require('../../../../app/scripts/metamask-controller')
const firstTimeState = require('../../../unit/localhostState')
diff --git a/test/unit/ui/app/components/token-cell.spec.js b/test/unit/ui/app/components/token-cell.spec.js
index 6145c6924..23e76c418 100644
--- a/test/unit/ui/app/components/token-cell.spec.js
+++ b/test/unit/ui/app/components/token-cell.spec.js
@@ -5,8 +5,8 @@ import { Provider } from 'react-redux'
import configureMockStore from 'redux-mock-store'
import { mount } from 'enzyme'
-import TokenCell from '../../../../../ui/app/components/token-cell'
-import Identicon from '../../../../../ui/app/components/identicon'
+import TokenCell from '../../../../../ui/app/components/app/token-cell'
+import Identicon from '../../../../../ui/app/components/ui/identicon'
describe('Token Cell', () => {
let wrapper
diff --git a/test/unit/ui/app/reducers/app.spec.js b/test/unit/ui/app/reducers/app.spec.js
index bee4963e5..6c77e0ef9 100644
--- a/test/unit/ui/app/reducers/app.spec.js
+++ b/test/unit/ui/app/reducers/app.spec.js
@@ -1,6 +1,6 @@
import assert from 'assert'
-import reduceApp from '../../../../../ui/app/reducers/app'
-import * as actions from '../../../../../ui/app/actions'
+import reduceApp from '../../../../../ui/app/ducks/app/app'
+import * as actions from '../../../../../ui/app/store/actions'
describe('App State', () => {
diff --git a/test/unit/ui/app/reducers/metamask.spec.js b/test/unit/ui/app/reducers/metamask.spec.js
index 8cdb780fe..388c67c76 100644
--- a/test/unit/ui/app/reducers/metamask.spec.js
+++ b/test/unit/ui/app/reducers/metamask.spec.js
@@ -1,6 +1,6 @@
import assert from 'assert'
-import reduceMetamask from '../../../../../ui/app/reducers/metamask'
-import * as actions from '../../../../../ui/app/actions'
+import reduceMetamask from '../../../../../ui/app/ducks/metamask/metamask'
+import * as actions from '../../../../../ui/app/store/actions'
describe('MetaMask Reducers', () => {
diff --git a/test/unit/ui/app/selectors.spec.js b/test/unit/ui/app/selectors.spec.js
index 070de0bcd..b4aa8e272 100644
--- a/test/unit/ui/app/selectors.spec.js
+++ b/test/unit/ui/app/selectors.spec.js
@@ -1,5 +1,5 @@
const assert = require('assert')
-const selectors = require('../../../../ui/app/selectors')
+const selectors = require('../../../../ui/app/selectors/selectors')
const mockState = require('../../../data/mock-state.json')
const Eth = require('ethjs')
diff --git a/test/unit/util_test.js b/test/unit/util_test.js
index 39473854f..87f57b218 100644
--- a/test/unit/util_test.js
+++ b/test/unit/util_test.js
@@ -3,7 +3,7 @@ var sinon = require('sinon')
const ethUtil = require('ethereumjs-util')
var path = require('path')
-var util = require(path.join(__dirname, '..', '..', 'ui', 'app', 'util.js'))
+var util = require(path.join(__dirname, '..', '..', 'ui', 'app', 'helpers', 'utils', 'util.js'))
describe('util', function () {
var ethInWei = '1'