Browse Source

fix(tests): fixed tests

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
d7653b445a
  1. 3
      test/components/AnimatedCheckmark.spec.js
  2. 7
      test/components/CryptoIcon.spec.js
  3. 3
      test/components/LoadingBolt.spec.js
  4. 162
      test/reducers/__snapshots__/channels.spec.js.snap

3
test/components/AnimatedCheckmark.spec.js

@ -3,12 +3,13 @@ import { shallow } from 'enzyme'
import Isvg from 'react-inlinesvg' import Isvg from 'react-inlinesvg'
import AnimatedCheckmark from '../../app/components/AnimatedCheckmark' import AnimatedCheckmark from '../../app/components/AnimatedCheckmark'
import checkmarkIcon from '../../app/components/AnimatedCheckmark/checkmark.svg'
describe('component.AnimatedCheckmark', () => { describe('component.AnimatedCheckmark', () => {
describe('default', () => { describe('default', () => {
it('should render default component', () => { it('should render default component', () => {
const el = shallow(<AnimatedCheckmark />) const el = shallow(<AnimatedCheckmark />)
expect(el.find(Isvg).props().src).toContain('checkmark.svg') expect(el.find(Isvg).props().src).toContain(checkmarkIcon)
}) })
}) })
}) })

7
test/components/CryptoIcon.spec.js

@ -3,6 +3,9 @@ import { shallow } from 'enzyme'
import Isvg from 'react-inlinesvg' import Isvg from 'react-inlinesvg'
import CryptoIcon from '../../app/components/CryptoIcon' import CryptoIcon from '../../app/components/CryptoIcon'
import skinnyBitcoinIcon from '../../app/icons/skinny_bitcoin.svg'
import litecoinIcon from '../../app/icons/litecoin.svg'
const defaultProps = { const defaultProps = {
currency: 'bch', currency: 'bch',
styles: {} styles: {}
@ -21,7 +24,7 @@ describe('component.CryptoIcon', () => {
const props = { ...defaultProps, currency: 'btc' } const props = { ...defaultProps, currency: 'btc' }
const el = shallow(<CryptoIcon {...props} />) const el = shallow(<CryptoIcon {...props} />)
it('should show btc symbol', () => { it('should show btc symbol', () => {
expect(el.find(Isvg).props().src).toContain('skinny_bitcoin.svg') expect(el.find(Isvg).props().src).toContain(skinnyBitcoinIcon)
}) })
}) })
@ -29,7 +32,7 @@ describe('component.CryptoIcon', () => {
const props = { ...defaultProps, currency: 'ltc' } const props = { ...defaultProps, currency: 'ltc' }
const el = shallow(<CryptoIcon {...props} />) const el = shallow(<CryptoIcon {...props} />)
it('should show ltc symbol', () => { it('should show ltc symbol', () => {
expect(el.find(Isvg).props().src).toContain('litecoin.svg') expect(el.find(Isvg).props().src).toContain(litecoinIcon)
}) })
}) })
}) })

3
test/components/LoadingBolt.spec.js

@ -2,11 +2,12 @@ import React from 'react'
import { shallow } from 'enzyme' import { shallow } from 'enzyme'
import Isvg from 'react-inlinesvg' import Isvg from 'react-inlinesvg'
import LoadingBolt from '../../app/components/LoadingBolt' import LoadingBolt from '../../app/components/LoadingBolt'
import cloudboltIcon from '../../app/icons/cloudbolt.svg'
describe('component.LoadingBolt', () => { describe('component.LoadingBolt', () => {
const el = shallow(<LoadingBolt />) const el = shallow(<LoadingBolt />)
it('should show defaults', () => { it('should show defaults', () => {
expect(el.find(Isvg).props().src).toContain('cloudbolt.svg') expect(el.find(Isvg).props().src).toContain(cloudboltIcon)
expect(el.text()).toContain('loading') expect(el.text()).toContain('loading')
}) })
}) })

162
test/reducers/__snapshots__/channels.spec.js.snap

@ -12,6 +12,33 @@ Object {
"channels": Array [], "channels": Array [],
"channelsLoading": true, "channelsLoading": true,
"closingChannel": false, "closingChannel": false,
"filter": Object {
"key": "ALL_CHANNELS",
"name": "All Channels",
},
"filterPulldown": false,
"filters": Array [
Object {
"key": "ALL_CHANNELS",
"name": "All Channels",
},
Object {
"key": "ACTIVE_CHANNELS",
"name": "Active Channels",
},
Object {
"key": "OPEN_CHANNELS",
"name": "Open Channels",
},
Object {
"key": "OPEN_PENDING_CHANNELS",
"name": "Open Pending Channels",
},
Object {
"key": "CLOSING_PENDING_CHANNELS",
"name": "Closing Pending Channels",
},
],
"openingChannel": false, "openingChannel": false,
"pendingChannels": Object { "pendingChannels": Object {
"pending_closing_channels": Array [], "pending_closing_channels": Array [],
@ -36,6 +63,33 @@ Object {
"channels": Array [], "channels": Array [],
"channelsLoading": false, "channelsLoading": false,
"closingChannel": false, "closingChannel": false,
"filter": Object {
"key": "ALL_CHANNELS",
"name": "All Channels",
},
"filterPulldown": false,
"filters": Array [
Object {
"key": "ALL_CHANNELS",
"name": "All Channels",
},
Object {
"key": "ACTIVE_CHANNELS",
"name": "Active Channels",
},
Object {
"key": "OPEN_CHANNELS",
"name": "Open Channels",
},
Object {
"key": "OPEN_PENDING_CHANNELS",
"name": "Open Pending Channels",
},
Object {
"key": "CLOSING_PENDING_CHANNELS",
"name": "Closing Pending Channels",
},
],
"openingChannel": true, "openingChannel": true,
"pendingChannels": Object { "pendingChannels": Object {
"pending_closing_channels": Array [], "pending_closing_channels": Array [],
@ -63,6 +117,33 @@ Object {
], ],
"channelsLoading": false, "channelsLoading": false,
"closingChannel": false, "closingChannel": false,
"filter": Object {
"key": "ALL_CHANNELS",
"name": "All Channels",
},
"filterPulldown": false,
"filters": Array [
Object {
"key": "ALL_CHANNELS",
"name": "All Channels",
},
Object {
"key": "ACTIVE_CHANNELS",
"name": "Active Channels",
},
Object {
"key": "OPEN_CHANNELS",
"name": "Open Channels",
},
Object {
"key": "OPEN_PENDING_CHANNELS",
"name": "Open Pending Channels",
},
Object {
"key": "CLOSING_PENDING_CHANNELS",
"name": "Closing Pending Channels",
},
],
"openingChannel": false, "openingChannel": false,
"pendingChannels": Array [ "pendingChannels": Array [
3, 3,
@ -85,6 +166,33 @@ Object {
"channels": Array [], "channels": Array [],
"channelsLoading": false, "channelsLoading": false,
"closingChannel": false, "closingChannel": false,
"filter": Object {
"key": "ALL_CHANNELS",
"name": "All Channels",
},
"filterPulldown": false,
"filters": Array [
Object {
"key": "ALL_CHANNELS",
"name": "All Channels",
},
Object {
"key": "ACTIVE_CHANNELS",
"name": "Active Channels",
},
Object {
"key": "OPEN_CHANNELS",
"name": "Open Channels",
},
Object {
"key": "OPEN_PENDING_CHANNELS",
"name": "Open Pending Channels",
},
Object {
"key": "CLOSING_PENDING_CHANNELS",
"name": "Closing Pending Channels",
},
],
"openingChannel": false, "openingChannel": false,
"pendingChannels": Object { "pendingChannels": Object {
"pending_closing_channels": Array [], "pending_closing_channels": Array [],
@ -109,6 +217,33 @@ Object {
"channels": Array [], "channels": Array [],
"channelsLoading": false, "channelsLoading": false,
"closingChannel": false, "closingChannel": false,
"filter": Object {
"key": "ALL_CHANNELS",
"name": "All Channels",
},
"filterPulldown": false,
"filters": Array [
Object {
"key": "ALL_CHANNELS",
"name": "All Channels",
},
Object {
"key": "ACTIVE_CHANNELS",
"name": "Active Channels",
},
Object {
"key": "OPEN_CHANNELS",
"name": "Open Channels",
},
Object {
"key": "OPEN_PENDING_CHANNELS",
"name": "Open Pending Channels",
},
Object {
"key": "CLOSING_PENDING_CHANNELS",
"name": "Closing Pending Channels",
},
],
"openingChannel": false, "openingChannel": false,
"pendingChannels": Object { "pendingChannels": Object {
"pending_closing_channels": Array [], "pending_closing_channels": Array [],
@ -133,6 +268,33 @@ Object {
"channels": Array [], "channels": Array [],
"channelsLoading": false, "channelsLoading": false,
"closingChannel": false, "closingChannel": false,
"filter": Object {
"key": "ALL_CHANNELS",
"name": "All Channels",
},
"filterPulldown": false,
"filters": Array [
Object {
"key": "ALL_CHANNELS",
"name": "All Channels",
},
Object {
"key": "ACTIVE_CHANNELS",
"name": "Active Channels",
},
Object {
"key": "OPEN_CHANNELS",
"name": "Open Channels",
},
Object {
"key": "OPEN_PENDING_CHANNELS",
"name": "Open Pending Channels",
},
Object {
"key": "CLOSING_PENDING_CHANNELS",
"name": "Closing Pending Channels",
},
],
"openingChannel": false, "openingChannel": false,
"pendingChannels": Object { "pendingChannels": Object {
"pending_closing_channels": Array [], "pending_closing_channels": Array [],

Loading…
Cancel
Save