Removing use of notify to update progress bar
This commit is contained in:
@@ -131,18 +131,6 @@ describe('parser/javascript/node.js', function() {
|
||||
.done();
|
||||
});
|
||||
|
||||
it('notifies of the progress when the render is not canceled', function(done) {
|
||||
this.node.state.renderCounter = 116;
|
||||
this.node.state.maxCounter = 200;
|
||||
|
||||
this.node.deferredStep('result')
|
||||
.then(null, null, progress => {
|
||||
expect(Math.round(100 * progress)).toEqual(42);
|
||||
})
|
||||
.finally(done)
|
||||
.done();
|
||||
});
|
||||
|
||||
it('rejects the returned promise when the render is canceled', function(done) {
|
||||
var resolve = jasmine.createSpy('resolve'),
|
||||
reject = jasmine.createSpy('reject');
|
||||
@@ -243,16 +231,6 @@ describe('parser/javascript/node.js', function() {
|
||||
expect(this.node.state.renderCounter).toEqual(1);
|
||||
});
|
||||
|
||||
it('sets the maxCounter', function() {
|
||||
this.node.state.renderCounter = 42;
|
||||
this.node.state.maxCounter = 0;
|
||||
this.node.startRender();
|
||||
expect(this.node.state.maxCounter).toEqual(43);
|
||||
this.node.state.maxCounter = 50;
|
||||
this.node.startRender();
|
||||
expect(this.node.state.maxCounter).toEqual(50);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe('#doneRender', function() {
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import ParserState from 'src/js/parser/javascript/parser_state.js';
|
||||
|
||||
describe('parser/javascript/parser_state.js', function() {
|
||||
|
||||
beforeEach(function() {
|
||||
this.progress = { style: {} };
|
||||
this.state = new ParserState(this.progress);
|
||||
});
|
||||
|
||||
describe('renderCounter property', function() {
|
||||
|
||||
it('sets the width of the progress element to the percent of completed steps', function() {
|
||||
this.state.renderCounter = 50;
|
||||
expect(this.progress.style.width).toEqual('0.00%');
|
||||
this.state.renderCounter = 10;
|
||||
expect(this.progress.style.width).toEqual('80.00%');
|
||||
});
|
||||
|
||||
it('does not change the width of the progress element when rendering has been cancelled', function() {
|
||||
this.state.renderCounter = 50;
|
||||
this.state.renderCounter = 40;
|
||||
expect(this.progress.style.width).toEqual('20.00%');
|
||||
this.state.cancelRender = true;
|
||||
this.state.renderCounter = 10;
|
||||
expect(this.progress.style.width).toEqual('20.00%');
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user