Skip to content
Snippets Groups Projects
Commit 5dceaa67 authored by Phil Hughes's avatar Phil Hughes
Browse files

Added tests for main component

parent 7c131df7
No related branches found
No related tags found
No related merge requests found
Pipeline #
import Vue from 'vue';
import json from '../../fixtures/file.json';
import Notebook from '../index';
const Component = Vue.extend(Notebook);
describe('Notebook component', () => {
let vm;
describe('without JSON', () => {
beforeEach((done) => {
vm = new Component({
propsData: {
notebook: {},
},
});
vm.$mount();
setTimeout(() => {
done();
});
});
test('does not render', () => {
expect(vm.$el.tagName).toBeUndefined();
});
});
describe('with JSON', () => {
beforeEach((done) => {
vm = new Component({
propsData: {
notebook: json,
},
});
vm.$mount();
setTimeout(() => {
done();
});
});
test('renders cells', () => {
expect(vm.$el.querySelectorAll('.cell').length).toBe(2);
});
test('renders markdown cell', () => {
expect(vm.$el.querySelector('.markdown')).not.toBeNull();
});
test('renders code cell', () => {
expect(vm.$el.querySelector('pre')).not.toBeNull();
});
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment