BigW Consortium Gitlab

Removed prepend in favour of clean and appendChild

parent 897d8d54
...@@ -6,7 +6,8 @@ class Spinner { ...@@ -6,7 +6,8 @@ class Spinner {
} }
start() { start() {
this.renderable.prepend(this.container); this.renderable.innerHTML = '';
this.renderable.appendChild(this.container);
} }
stop() { stop() {
......
...@@ -31,7 +31,7 @@ describe('Spinner', () => { ...@@ -31,7 +31,7 @@ describe('Spinner', () => {
describe('start', () => { describe('start', () => {
beforeEach(() => { beforeEach(() => {
renderable = jasmine.createSpyObj('renderable', ['prepend']); renderable = jasmine.createSpyObj('renderable', ['appendChild']);
container = {}; container = {};
spinner = { spinner = {
...@@ -42,8 +42,12 @@ describe('Spinner', () => { ...@@ -42,8 +42,12 @@ describe('Spinner', () => {
Spinner.prototype.start.call(spinner); Spinner.prototype.start.call(spinner);
}); });
it('should call .prepend', () => { it('should set .innerHTML to an empty string', () => {
expect(renderable.prepend).toHaveBeenCalledWith(container); 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