BigW Consortium Gitlab

Removed prepend in favour of clean and appendChild

parent 897d8d54
......@@ -6,7 +6,8 @@ class Spinner {
}
start() {
this.renderable.prepend(this.container);
this.renderable.innerHTML = '';
this.renderable.appendChild(this.container);
}
stop() {
......
......@@ -31,7 +31,7 @@ describe('Spinner', () => {
describe('start', () => {
beforeEach(() => {
renderable = jasmine.createSpyObj('renderable', ['prepend']);
renderable = jasmine.createSpyObj('renderable', ['appendChild']);
container = {};
spinner = {
......@@ -42,8 +42,12 @@ describe('Spinner', () => {
Spinner.prototype.start.call(spinner);
});
it('should call .prepend', () => {
expect(renderable.prepend).toHaveBeenCalledWith(container);
it('should set .innerHTML to an empty string', () => {
expect(renderable.innerHTML).toEqual('');
});
it('should call .appendChild', () => {
expect(renderable.appendChild).toHaveBeenCalledWith(container);
});
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment