Skip to content

Commit

Permalink
Added the missing test file.
Browse files Browse the repository at this point in the history
  • Loading branch information
jclo committed Jul 4, 2017
1 parent 7a07d91 commit ec46322
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions test/testvizucreateclass.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/* global describe, it */
/* eslint import/no-extraneous-dependencies: 1, no-unused-expressions: 1 */

// -- Node modules
import { expect } from 'chai';

// -- Local modules
import { Vizu } from '../index';


// -- Local constants


// -- Local variables


// Create a few Web Components:
const Aaa = Vizu.createClass();

const Bbb = Vizu.createClass({
render() {
return `
<div class='aaa'>
<h1>Title</h1>
</div>
`;
},
});


// -- Main
export default function(dom) {
//
describe('Test Vizu.createClass() method:', () => {
const view = Vizu.render(
'<Bbb />',
{ '<Bbb />': Bbb },
dom.window.document.getElementById('app50'),
);

it('Expects Vizu.createClass() without any arguments to return null.', () => {
expect(Aaa).to.be.null;
});

it('Expects Vizu.createClass({ ... }) to return an object.', () => {
expect(view).to.be.an('object');
});

it('Expects this object to own the property Bbb.', () => {
expect(view).to.have.own.property('Bbb');
});
it('Expects the property Bbb to be an object.', () => {
expect(view.Bbb).to.be.an('object');
});
it('Expects the object Bbb to have own property id.', () => {
expect(view.Bbb).to.have.own.property('id');
});
it('Expects this property to be a string.', () => {
expect(view.Bbb.id).to.be.a('string');
});
it('Expects the object Bbb to have own property cList.', () => {
expect(view.Bbb).to.have.own.property('cList');
});
it('Expects this property to be null.', () => {
expect(view.Bbb.cList).to.be.null;
});
it('Expects the object Bbb to have own property components.', () => {
expect(view.Bbb).to.have.own.property('components');
});
it('Expects this property to be null.', () => {
expect(view.Bbb.components).to.be.null;
});
});
}

0 comments on commit ec46322

Please sign in to comment.