11import Vue from 'vue' ;
22import VueRouter from 'vue-router' ;
33import Component from 'vue-class-component' ;
4- import Sinon from 'sinon' ;
5- import { expect } from 'chai' ;
6- import { ComponentTest , MockLogger } from '../../util/component-test' ;
4+ import { spy , assert } from 'sinon' ;
5+ import { expect } from 'chai' ;
6+ import { ComponentTest , MockLogger } from '../../util/component-test' ;
77import { NavbarComponent } from './navbar' ;
88
9- let loggerSpy = Sinon . spy ( ) ;
9+ let loggerSpy = spy ( ) ;
1010
1111@Component ( {
1212 template : require ( './navbar.html' )
@@ -32,9 +32,9 @@ describe('Navbar component', () => {
3232
3333 router = new VueRouter ( {
3434 routes : [
35- { path : '/' , component : homeComponent } ,
36- { path : '/about' , component : aboutComponent } ,
37- { path : '/list' , component : listComponent }
35+ { path : '/' , component : homeComponent } ,
36+ { path : '/about' , component : aboutComponent } ,
37+ { path : '/list' , component : listComponent }
3838 ]
3939 } ) ;
4040 } ) ;
@@ -43,8 +43,9 @@ describe('Navbar component', () => {
4343 directiveTest . createComponent ( { router : router } ) ;
4444
4545 await directiveTest . execute ( ( vm ) => { // ensure Vue has bootstrapped/run change detection
46- expect ( loggerSpy ) . toHaveBeenCalledWith ( 'Default object property!' ) ;
47- expect ( vm . $el . querySelectorAll ( 'ul.nav li' ) . length ) . toBe ( 3 ) ;
46+ debugger ;
47+ assert . calledWith ( loggerSpy , 'Default object property!' ) ;
48+ expect ( vm . $el . querySelectorAll ( 'ul.nav li' ) . length ) . to . equal ( 3 ) ;
4849 } ) ;
4950 } ) ;
5051
@@ -60,7 +61,7 @@ describe('Navbar component', () => {
6061
6162 it ( 'should render correct about contents' , async ( ) => {
6263 await directiveTest . execute ( ( vm ) => {
63- expect ( vm . $el . querySelector ( 'div.about' ) . textContent ) . toEqual ( 'About' ) ;
64+ expect ( vm . $el . querySelector ( 'div.about' ) . textContent ) . to . equal ( 'About' ) ;
6465 } ) ;
6566 } ) ;
6667 } ) ;
@@ -77,7 +78,7 @@ describe('Navbar component', () => {
7778
7879 it ( 'should render correct about contents' , async ( ) => {
7980 await directiveTest . execute ( ( vm ) => {
80- expect ( vm . $el . querySelector ( 'div.list' ) . textContent ) . toEqual ( 'List' ) ;
81+ expect ( vm . $el . querySelector ( 'div.list' ) . textContent ) . to . equal ( 'List' ) ;
8182 } ) ;
8283 } ) ;
8384 } ) ;
0 commit comments