Skip to content

Instantly share code, notes, and snippets.

@seogi1004
Created January 7, 2019 14:00
Show Gist options
  • Save seogi1004/90a98f46f0efb4251ced264fe30916ee to your computer and use it in GitHub Desktop.
Save seogi1004/90a98f46f0efb4251ced264fe30916ee to your computer and use it in GitHub Desktop.
import { shallow } from 'vue-test-utils'
import DetailMarketComp from '@/detailMarket'
import { data } from '../samples.js'
describe('detailMarket.vue', () => {
let cmp ;
beforeEach(() => {
cmp = shallow(DetailMarketComp, {
propsData: {
title: 'Min Market Cap',
data: data[2]
}
});
});
it('snapshot', () => {
cmp.vm.$nextTick(() => {
expect(cmp.vm.$el).toMatchSnapshot();
});
});
it('computed', () => {
expect(cmp.vm.maxYear).toEqual('2017');
expect(cmp.vm.minYear).toEqual('2015');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment