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
abb73256
Commit
abb73256
authored
Apr 27, 2017
by
Clement Ho
Committed by
Phil Hughes
Apr 27, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for multiple assignees issue board cards
parent
99dc45e0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
16 deletions
+88
-16
spec/javascripts/boards/issue_card_spec.js
spec/javascripts/boards/issue_card_spec.js
+80
-13
spec/javascripts/boards/issue_spec.js
spec/javascripts/boards/issue_spec.js
+4
-2
spec/javascripts/boards/list_spec.js
spec/javascripts/boards/list_spec.js
+2
-1
spec/javascripts/boards/modal_store_spec.js
spec/javascripts/boards/modal_store_spec.js
+2
-0
No files found.
spec/javascripts/boards/issue_card_spec.js
View file @
abb73256
...
@@ -40,6 +40,7 @@ describe('Issue card component', () => {
...
@@ -40,6 +40,7 @@ describe('Issue card component', () => {
iid
:
1
,
iid
:
1
,
confidential
:
false
,
confidential
:
false
,
labels
:
[
list
.
label
],
labels
:
[
list
.
label
],
assignees
:
[],
});
});
component
=
new
Vue
({
component
=
new
Vue
({
...
@@ -92,12 +93,12 @@ describe('Issue card component', () => {
...
@@ -92,12 +93,12 @@ describe('Issue card component', () => {
it
(
'
renders confidential icon
'
,
(
done
)
=>
{
it
(
'
renders confidential icon
'
,
(
done
)
=>
{
component
.
issue
.
confidential
=
true
;
component
.
issue
.
confidential
=
true
;
setTimeout
(()
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
expect
(
component
.
$el
.
querySelector
(
'
.confidential-icon
'
),
component
.
$el
.
querySelector
(
'
.confidential-icon
'
),
).
not
.
toBeNull
();
).
not
.
toBeNull
();
done
();
done
();
}
,
0
);
});
});
});
it
(
'
renders issue ID with #
'
,
()
=>
{
it
(
'
renders issue ID with #
'
,
()
=>
{
...
@@ -109,34 +110,32 @@ describe('Issue card component', () => {
...
@@ -109,34 +110,32 @@ describe('Issue card component', () => {
describe
(
'
assignee
'
,
()
=>
{
describe
(
'
assignee
'
,
()
=>
{
it
(
'
does not render assignee
'
,
()
=>
{
it
(
'
does not render assignee
'
,
()
=>
{
expect
(
expect
(
component
.
$el
.
querySelector
(
'
.card-assignee
'
),
component
.
$el
.
querySelector
(
'
.card-assignee
.avatar
'
),
).
toBeNull
();
).
toBeNull
();
});
});
describe
(
'
exists
'
,
()
=>
{
describe
(
'
exists
'
,
()
=>
{
beforeEach
((
done
)
=>
{
beforeEach
((
done
)
=>
{
component
.
issue
.
assignee
=
user
;
component
.
issue
.
assignee
s
=
[
user
]
;
setTimeout
(()
=>
{
Vue
.
nextTick
(()
=>
done
());
done
();
},
0
);
});
});
it
(
'
renders assignee
'
,
()
=>
{
it
(
'
renders assignee
'
,
()
=>
{
expect
(
expect
(
component
.
$el
.
querySelector
(
'
.card-assignee
'
),
component
.
$el
.
querySelector
(
'
.card-assignee
.avatar
'
),
).
not
.
toBeNull
();
).
not
.
toBeNull
();
});
});
it
(
'
sets title
'
,
()
=>
{
it
(
'
sets title
'
,
()
=>
{
expect
(
expect
(
component
.
$el
.
querySelector
(
'
.card-assignee
'
).
getAttribute
(
'
title
'
),
component
.
$el
.
querySelector
(
'
.card-assignee
a
'
).
getAttribute
(
'
title
'
),
).
toContain
(
`Assigned to
${
user
.
name
}
`
);
).
toContain
(
`Assigned to
${
user
.
name
}
`
);
});
});
it
(
'
sets users path
'
,
()
=>
{
it
(
'
sets users path
'
,
()
=>
{
expect
(
expect
(
component
.
$el
.
querySelector
(
'
.card-assignee
'
).
getAttribute
(
'
href
'
),
component
.
$el
.
querySelector
(
'
.card-assignee
a
'
).
getAttribute
(
'
href
'
),
).
toBe
(
'
/test
'
);
).
toBe
(
'
/test
'
);
});
});
...
@@ -148,6 +147,76 @@ describe('Issue card component', () => {
...
@@ -148,6 +147,76 @@ describe('Issue card component', () => {
});
});
});
});
describe
(
'
multiple assignees
'
,
()
=>
{
beforeEach
((
done
)
=>
{
component
.
issue
.
assignees
=
[
user
,
new
ListUser
({
id
:
2
,
name
:
'
user2
'
,
username
:
'
user2
'
,
avatar
:
'
test_image
'
,
}),
new
ListUser
({
id
:
3
,
name
:
'
user3
'
,
username
:
'
user3
'
,
avatar
:
'
test_image
'
,
}),
new
ListUser
({
id
:
4
,
name
:
'
user4
'
,
username
:
'
user4
'
,
avatar
:
'
test_image
'
,
})];
Vue
.
nextTick
(()
=>
done
());
});
it
(
'
renders all four assignees
'
,
()
=>
{
expect
(
component
.
$el
.
querySelectorAll
(
'
.card-assignee .avatar
'
).
length
).
toEqual
(
4
);
});
describe
(
'
more than four assignees
'
,
()
=>
{
beforeEach
((
done
)
=>
{
component
.
issue
.
assignees
.
push
(
new
ListUser
({
id
:
5
,
name
:
'
user5
'
,
username
:
'
user5
'
,
avatar
:
'
test_image
'
,
}));
Vue
.
nextTick
(()
=>
done
());
});
it
(
'
renders more avatar counter
'
,
()
=>
{
expect
(
component
.
$el
.
querySelector
(
'
.card-assignee .avatar-counter
'
).
innerText
).
toEqual
(
'
+2
'
);
});
it
(
'
renders three assignees
'
,
()
=>
{
expect
(
component
.
$el
.
querySelectorAll
(
'
.card-assignee .avatar
'
).
length
).
toEqual
(
3
);
});
it
(
'
renders 99+ avatar counter
'
,
(
done
)
=>
{
for
(
let
i
=
5
;
i
<
104
;
i
++
)
{
const
u
=
new
ListUser
({
id
:
i
,
name
:
'
name
'
,
username
:
'
username
'
,
avatar
:
'
test_image
'
,
});
component
.
issue
.
assignees
.
push
(
u
);
}
Vue
.
nextTick
(()
=>
{
expect
(
component
.
$el
.
querySelector
(
'
.card-assignee .avatar-counter
'
).
innerText
).
toEqual
(
'
99+
'
);
done
();
});
});
});
})
describe
(
'
labels
'
,
()
=>
{
describe
(
'
labels
'
,
()
=>
{
it
(
'
does not render any
'
,
()
=>
{
it
(
'
does not render any
'
,
()
=>
{
expect
(
expect
(
...
@@ -159,9 +228,7 @@ describe('Issue card component', () => {
...
@@ -159,9 +228,7 @@ describe('Issue card component', () => {
beforeEach
((
done
)
=>
{
beforeEach
((
done
)
=>
{
component
.
issue
.
addLabel
(
label1
);
component
.
issue
.
addLabel
(
label1
);
setTimeout
(()
=>
{
Vue
.
nextTick
(()
=>
done
());
done
();
},
0
);
});
});
it
(
'
does not render list label
'
,
()
=>
{
it
(
'
does not render list label
'
,
()
=>
{
...
...
spec/javascripts/boards/issue_spec.js
View file @
abb73256
...
@@ -27,7 +27,8 @@ describe('Issue model', () => {
...
@@ -27,7 +27,8 @@ describe('Issue model', () => {
title
:
'
test
'
,
title
:
'
test
'
,
color
:
'
red
'
,
color
:
'
red
'
,
description
:
'
testing
'
description
:
'
testing
'
}]
}],
assignees
:
[],
});
});
});
});
...
@@ -90,7 +91,8 @@ describe('Issue model', () => {
...
@@ -90,7 +91,8 @@ describe('Issue model', () => {
iid
:
1
,
iid
:
1
,
confidential
:
false
,
confidential
:
false
,
relative_position
:
1
,
relative_position
:
1
,
labels
:
[]
labels
:
[],
assignees
:
[],
});
});
expect
(
relativePositionIssue
.
position
).
toBe
(
1
);
expect
(
relativePositionIssue
.
position
).
toBe
(
1
);
...
...
spec/javascripts/boards/list_spec.js
View file @
abb73256
...
@@ -94,7 +94,8 @@ describe('List model', () => {
...
@@ -94,7 +94,8 @@ describe('List model', () => {
title
:
'
Testing
'
,
title
:
'
Testing
'
,
iid
:
1
,
iid
:
1
,
confidential
:
false
,
confidential
:
false
,
labels
:
[
list
.
label
,
listDup
.
label
]
labels
:
[
list
.
label
,
listDup
.
label
],
assignees
:
[],
});
});
list
.
issues
.
push
(
issue
);
list
.
issues
.
push
(
issue
);
...
...
spec/javascripts/boards/modal_store_spec.js
View file @
abb73256
...
@@ -21,12 +21,14 @@ describe('Modal store', () => {
...
@@ -21,12 +21,14 @@ describe('Modal store', () => {
iid
:
1
,
iid
:
1
,
confidential
:
false
,
confidential
:
false
,
labels
:
[],
labels
:
[],
assignees
:
[],
});
});
issue2
=
new
ListIssue
({
issue2
=
new
ListIssue
({
title
:
'
Testing
'
,
title
:
'
Testing
'
,
iid
:
2
,
iid
:
2
,
confidential
:
false
,
confidential
:
false
,
labels
:
[],
labels
:
[],
assignees
:
[],
});
});
Store
.
store
.
issues
.
push
(
issue
);
Store
.
store
.
issues
.
push
(
issue
);
Store
.
store
.
issues
.
push
(
issue2
);
Store
.
store
.
issues
.
push
(
issue2
);
...
...
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