Initial commit

This commit is contained in:
zhongjin
2020-06-15 10:58:47 +08:00
commit 4f1dfe7564
8590 changed files with 1516878 additions and 0 deletions
@@ -0,0 +1,37 @@
var ErrorView = require('builder/components/error/error-view');
describe('components/error/error-view', function () {
beforeEach(function () {
this.view = new ErrorView();
this.view.render();
});
it('should have no leaks', function () {
expect(this.view).toHaveNoLeaks();
});
it('should render default texts', function () {
var html = this.view.$el.html();
expect(html).toContain('default-title');
expect(html).toContain('default-desc');
});
describe('when given custom title and desc', function () {
beforeEach(function () {
this.view.clean();
this.view = new ErrorView({
title: 'custom title',
desc: 'custom desc'
});
this.view.render();
});
it('should render custom texts instead', function () {
var html = this.view.$el.html();
expect(html).not.toContain('default-title');
expect(html).not.toContain('default-desc');
expect(html).toContain('custom title');
expect(html).toContain('custom desc');
});
});
});