Skip to content

Commit

Permalink
refactor(mocks): move fakeStore & products
Browse files Browse the repository at this point in the history
  • Loading branch information
14nrv committed Jun 10, 2018
1 parent df486c2 commit bee6eec
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions __tests__/__mocks__/fakeStore.js → __mocks__/fakeStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import pkg from '@/store/modules/package'
import cart from '@/store/modules/cart'
import checkout from '@/store/modules/checkout'
import product from '@/store/modules/product'
import products from '@/__tests__/__mocks__/products.json'
import products from '@/__mocks__/products.json'

const fakeStore = {
modules: {
pkg,
cart,
checkout,
product: {
Expand All @@ -16,8 +17,7 @@ const fakeStore = {
fakeStore.modules.product.state.products = products
})
}
},
pkg
}
},
strict: false
}
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions components/CartProductListItem/CartProductListItem.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Vuex from 'vuex'
import Helpers from 'mwangaben-vthelpers'
import { shallow, createLocalVue } from '@vue/test-utils'
import fakeStore from '@/__tests__/__mocks__/fakeStore'
import fakeProducts from '@/__tests__/__mocks__/products.json'
import fakeStore from '@/__mocks__/fakeStore'
import fakeProducts from '@/__mocks__/products.json'
import CartProductListItem from './CartProductListItem'

jest.mock('@/plugins/firebase', () => jest.fn())
Expand Down
2 changes: 1 addition & 1 deletion components/Checkout/Checkout.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import axios from 'axios'
import VeeValidate from 'vee-validate'
import Helpers from 'mwangaben-vthelpers'
import { mount, createLocalVue } from '@vue/test-utils'
import fakeStore from '@/__tests__/__mocks__/fakeStore'
import fakeStore from '@/__mocks__/fakeStore'
import Checkout from './Checkout'

jest
Expand Down
2 changes: 1 addition & 1 deletion components/Header/Header.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Vuex from 'vuex'
import Helpers from 'mwangaben-vthelpers'
import { mount, createLocalVue } from '@vue/test-utils'
import fakeStore from '@/__tests__/__mocks__/fakeStore'
import fakeStore from '@/__mocks__/fakeStore'
import Header from './Header'

jest.mock('@/plugins/firebase', () => jest.fn())
Expand Down
4 changes: 2 additions & 2 deletions components/ProductListItem/ProductListItem.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Vuex from 'vuex'
import Helpers from 'mwangaben-vthelpers'
import { shallow, createLocalVue } from '@vue/test-utils'
import fakeStore from '@/__tests__/__mocks__/fakeStore'
import products from '@/__tests__/__mocks__/products.json'
import fakeStore from '@/__mocks__/fakeStore'
import products from '@/__mocks__/products.json'
import ProductListItem from './ProductListItem'

jest.mock('@/plugins/firebase', () => jest.fn())
Expand Down
2 changes: 1 addition & 1 deletion components/Sidebar/Sidebar.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Vuex from 'vuex'
import Helpers from 'mwangaben-vthelpers'
import { shallow, createLocalVue } from '@vue/test-utils'
import fakeStore from '@/__tests__/__mocks__/fakeStore'
import fakeStore from '@/__mocks__/fakeStore'
import Sidebar from './Sidebar'

jest.mock('@/plugins/firebase', () => jest.fn())
Expand Down
2 changes: 1 addition & 1 deletion components/Switch/Switch.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Vuex from 'vuex'
import Helpers from 'mwangaben-vthelpers'
import { shallow, createLocalVue } from '@vue/test-utils'
import fakeStore from '@/__tests__/__mocks__/fakeStore'
import fakeStore from '@/__mocks__/fakeStore'
import Switch from './Switch'

jest.mock('@/plugins/firebase', () => jest.fn())
Expand Down
2 changes: 1 addition & 1 deletion pages/cart.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Vuex from 'vuex'
import Helpers from 'mwangaben-vthelpers'
import { mount, createLocalVue } from '@vue/test-utils'
import fakeStore from '@/__tests__/__mocks__/fakeStore'
import fakeStore from '@/__mocks__/fakeStore'
import Cart from '@/pages/cart'

jest.mock('@/plugins/firebase', () => jest.fn())
Expand Down
2 changes: 1 addition & 1 deletion pages/index.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Vuex from 'vuex'
import Helpers from 'mwangaben-vthelpers'
import { mount, createLocalVue } from '@vue/test-utils'
import fakeStore from '@/__tests__/__mocks__/fakeStore'
import fakeStore from '@/__mocks__/fakeStore'
import pkg from '@/package.json'
import Index from '@/pages/index'
import ProductListItem from '@/components/ProductListItem'
Expand Down
4 changes: 2 additions & 2 deletions pages/products/_slug.spec.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Vuex from 'vuex'
import Helpers from 'mwangaben-vthelpers'
import { shallow, createLocalVue } from '@vue/test-utils'
import fakeStore from '@/__tests__/__mocks__/fakeStore'
import fakeProducts from '@/__tests__/__mocks__/products.json'
import fakeStore from '@/__mocks__/fakeStore'
import fakeProducts from '@/__mocks__/products.json'
import pkg from '@/package.json'
import ProductDetail from '@/pages/products/_slug'
import { slug } from '@/helpers'
Expand Down

0 comments on commit bee6eec

Please sign in to comment.