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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
9636da30
Commit
9636da30
authored
Aug 02, 2017
by
kushalpandya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use `$mount` for component rendering, remove tests for `props` datatype as unnecessary
parent
018e1bd5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
26 deletions
+4
-26
spec/javascripts/groups/group_identicon_spec.js
spec/javascripts/groups/group_identicon_spec.js
+4
-26
No files found.
spec/javascripts/groups/group_identicon_spec.js
View file @
9636da30
...
@@ -9,40 +9,18 @@ const createComponent = () => {
...
@@ -9,40 +9,18 @@ const createComponent = () => {
const
group
=
store
.
decorateGroup
(
group1
);
const
group
=
store
.
decorateGroup
(
group1
);
return
new
Component
({
return
new
Component
({
el
:
document
.
createElement
(
'
div
'
),
propsData
:
{
propsData
:
{
entityId
:
group
.
id
,
entityId
:
group
.
id
,
entityName
:
group
.
name
,
entityName
:
group
.
name
,
},
},
});
})
.
$mount
()
;
};
};
describe
(
'
GroupIdenticonComponent
'
,
()
=>
{
describe
(
'
GroupIdenticonComponent
'
,
()
=>
{
let
vm
;
let
vm
;
let
el
;
beforeEach
(()
=>
{
beforeEach
(()
=>
{
vm
=
createComponent
();
vm
=
createComponent
();
el
=
vm
.
$el
;
});
describe
(
'
props
'
,
()
=>
{
it
(
'
should have props with defined data types
'
,
(
done
)
=>
{
const
identiconProps
=
groupIdenticonComponent
.
props
;
const
EntityIdTypeClass
=
identiconProps
.
entityId
.
type
;
const
EntityNameTypeClass
=
identiconProps
.
entityName
.
type
;
Vue
.
nextTick
(()
=>
{
expect
(
identiconProps
.
entityId
).
toBeDefined
();
expect
(
new
EntityIdTypeClass
()
instanceof
Number
).
toBeTruthy
();
expect
(
identiconProps
.
entityId
.
required
).
toBeTruthy
();
expect
(
identiconProps
.
entityName
).
toBeDefined
();
expect
(
new
EntityNameTypeClass
()
instanceof
String
).
toBeTruthy
();
expect
(
identiconProps
.
entityName
.
required
).
toBeTruthy
();
done
();
});
});
});
});
describe
(
'
computed
'
,
()
=>
{
describe
(
'
computed
'
,
()
=>
{
...
@@ -74,9 +52,9 @@ describe('GroupIdenticonComponent', () => {
...
@@ -74,9 +52,9 @@ describe('GroupIdenticonComponent', () => {
describe
(
'
template
'
,
()
=>
{
describe
(
'
template
'
,
()
=>
{
it
(
'
should render identicon
'
,
()
=>
{
it
(
'
should render identicon
'
,
()
=>
{
expect
(
el
.
nodeName
).
toBe
(
'
DIV
'
);
expect
(
vm
.
$
el
.
nodeName
).
toBe
(
'
DIV
'
);
expect
(
el
.
classList
.
contains
(
'
identicon
'
)).
toBeTruthy
();
expect
(
vm
.
$
el
.
classList
.
contains
(
'
identicon
'
)).
toBeTruthy
();
expect
(
el
.
getAttribute
(
'
style
'
).
indexOf
(
'
background-color
'
)
>
-
1
).
toBeTruthy
();
expect
(
vm
.
$
el
.
getAttribute
(
'
style
'
).
indexOf
(
'
background-color
'
)
>
-
1
).
toBeTruthy
();
});
});
});
});
});
});
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