Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
f6ebb90a
Commit
f6ebb90a
authored
Apr 28, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deleted spinner and spec
parent
fc954749
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
130 deletions
+0
-130
app/assets/javascripts/spinner.js
app/assets/javascripts/spinner.js
+0
-29
spec/javascripts/spinner_spec.js
spec/javascripts/spinner_spec.js
+0
-101
No files found.
app/assets/javascripts/spinner.js
deleted
100644 → 0
View file @
fc954749
class
Spinner
{
constructor
(
renderable
)
{
this
.
renderable
=
renderable
;
this
.
container
=
Spinner
.
createContainer
();
}
start
()
{
this
.
renderable
.
innerHTML
=
''
;
this
.
renderable
.
appendChild
(
this
.
container
);
}
stop
()
{
this
.
container
.
remove
();
}
static
createContainer
()
{
const
container
=
document
.
createElement
(
'
div
'
);
container
.
classList
.
add
(
'
loading
'
);
container
.
innerHTML
=
Spinner
.
TEMPLATE
;
return
container
;
}
}
Spinner
.
TEMPLATE
=
'
<i class="fa fa-spinner fa-spin"></i>
'
;
export
default
Spinner
;
spec/javascripts/spinner_spec.js
deleted
100644 → 0
View file @
fc954749
import
Spinner
from
'
~/spinner
'
;
import
ClassSpecHelper
from
'
./helpers/class_spec_helper
'
;
describe
(
'
Spinner
'
,
()
=>
{
let
renderable
;
let
container
;
let
spinner
;
describe
(
'
class constructor
'
,
()
=>
{
beforeEach
(()
=>
{
renderable
=
{};
container
=
{};
spyOn
(
Spinner
,
'
createContainer
'
).
and
.
returnValue
(
container
);
spinner
=
new
Spinner
(
renderable
);
});
it
(
'
should set .renderable
'
,
()
=>
{
expect
(
spinner
.
renderable
).
toBe
(
renderable
);
});
it
(
'
should call Spinner.createContainer
'
,
()
=>
{
expect
(
Spinner
.
createContainer
).
toHaveBeenCalled
();
});
it
(
'
should set .container
'
,
()
=>
{
expect
(
spinner
.
container
).
toBe
(
container
);
});
});
describe
(
'
start
'
,
()
=>
{
beforeEach
(()
=>
{
renderable
=
jasmine
.
createSpyObj
(
'
renderable
'
,
[
'
appendChild
'
]);
container
=
{};
spinner
=
{
renderable
,
container
,
};
Spinner
.
prototype
.
start
.
call
(
spinner
);
});
it
(
'
should set .innerHTML to an empty string
'
,
()
=>
{
expect
(
renderable
.
innerHTML
).
toEqual
(
''
);
});
it
(
'
should call .appendChild
'
,
()
=>
{
expect
(
renderable
.
appendChild
).
toHaveBeenCalledWith
(
container
);
});
});
describe
(
'
stop
'
,
()
=>
{
beforeEach
(()
=>
{
container
=
jasmine
.
createSpyObj
(
'
container
'
,
[
'
remove
'
]);
spinner
=
{
container
,
};
Spinner
.
prototype
.
stop
.
call
(
spinner
);
});
it
(
'
should call .remove
'
,
()
=>
{
expect
(
container
.
remove
).
toHaveBeenCalled
();
});
});
describe
(
'
createContainer
'
,
()
=>
{
let
createContainer
;
beforeEach
(()
=>
{
container
=
{
classList
:
jasmine
.
createSpyObj
(
'
classList
'
,
[
'
add
'
]),
};
spyOn
(
document
,
'
createElement
'
).
and
.
returnValue
(
container
);
createContainer
=
Spinner
.
createContainer
();
});
ClassSpecHelper
.
itShouldBeAStaticMethod
(
Spinner
,
'
createContainer
'
);
it
(
'
should call document.createElement
'
,
()
=>
{
expect
(
document
.
createElement
).
toHaveBeenCalledWith
(
'
div
'
);
});
it
(
'
should call classList.add
'
,
()
=>
{
expect
(
container
.
classList
.
add
).
toHaveBeenCalledWith
(
'
loading
'
);
});
it
(
'
should return the container element
'
,
()
=>
{
expect
(
createContainer
).
toBe
(
container
);
});
it
(
'
should set the container .innerHTML to Spinner.TEMPLATE
'
,
()
=>
{
expect
(
container
.
innerHTML
).
toBe
(
Spinner
.
TEMPLATE
);
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment