-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}); | ||
}); | ||
} |