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
dc00a280
Commit
dc00a280
authored
Apr 05, 2019
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove EE-specic parts from issue_card_spec.js
parent
08699259
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
98 additions
and
81 deletions
+98
-81
ee/spec/javascripts/boards/issue_card_spec.js
ee/spec/javascripts/boards/issue_card_spec.js
+98
-36
spec/javascripts/boards/issue_card_spec.js
spec/javascripts/boards/issue_card_spec.js
+0
-45
No files found.
ee/spec/javascripts/boards/issue_card_spec.js
View file @
dc00a280
/* global ListLabel */
/* global ListIssue */
import
Vue
from
'
vue
'
;
import
_
from
'
underscore
'
;
import
'
~/vue_shared/models/label
'
;
import
'
~/vue_shared/models/assignee
'
;
import
'
~/boards/models/issue
'
;
import
'
~/boards/models/list
'
;
import
IssueCardInner
from
'
~/boards/components/issue_card_inner.vue
'
;
import
ListIssue
from
'
ee/boards/models/issue
'
;
import
mountComponent
from
'
spec/helpers/vue_mount_component_helper
'
;
import
{
listObj
}
from
'
spec/boards/mock_data
'
;
describe
(
'
Issue card component
'
,
()
=>
{
let
vm
;
const
Component
=
Vue
.
extend
(
IssueCardInner
);
const
list
=
listObj
;
const
issue
=
new
ListIssue
({
title
:
'
Testing
'
,
id
:
1
,
iid
:
1
,
confidential
:
false
,
labels
:
[
list
.
label
],
assignees
:
[],
const
label1
=
new
ListLabel
({
id
:
3
,
title
:
'
testing 123
'
,
color
:
'
blue
'
,
text_color
:
'
white
'
,
description
:
'
test
'
,
});
let
component
;
let
issue
;
let
list
;
afterEach
(()
=>
{
vm
.
$destroy
();
});
beforeEach
(()
=>
{
setFixtures
(
'
<div class="test-container"></div>
'
);
it
(
'
does not render issue weight if none specified
'
,
()
=>
{
vm
=
mountComponent
(
Component
,
{
list
,
issue
,
issueLinkBase
:
'
/test
'
,
rootPath
:
'
/
'
,
groupId
:
null
,
list
=
listObj
;
issue
=
new
ListIssue
({
title
:
'
Testing
'
,
id
:
1
,
iid
:
1
,
confidential
:
false
,
labels
:
[
list
.
label
],
assignees
:
[],
reference_path
:
'
#1
'
,
real_path
:
'
/test/1
'
,
});
expect
(
vm
.
$el
.
querySelector
(
'
.board-card-weight
'
)).
toBeNull
();
component
=
new
Vue
({
el
:
document
.
querySelector
(
'
.test-container
'
),
components
:
{
'
issue-card
'
:
IssueCardInner
,
},
data
()
{
return
{
list
,
issue
,
issueLinkBase
:
'
/test
'
,
rootPath
:
'
/
'
,
groupId
:
null
,
};
},
template
:
`
<issue-card
:issue="issue"
:list="list"
:group-id="groupId"
:issue-link-base="issueLinkBase"
:root-path="rootPath"></issue-card>
`
,
});
});
it
(
'
renders issue weight if specified
'
,
()
=>
{
vm
=
mountComponent
(
Component
,
{
list
,
issue
:
{
...
issue
,
weight
:
2
,
},
issueLinkBase
:
'
/test
'
,
rootPath
:
'
/
'
,
groupId
:
null
,
describe
(
'
labels
'
,
()
=>
{
beforeEach
(
done
=>
{
component
.
issue
.
addLabel
(
label1
);
Vue
.
nextTick
(()
=>
done
());
});
const
el
=
vm
.
$el
.
querySelector
(
'
.board-card-weight
'
);
expect
(
el
).
not
.
toBeNull
();
expect
(
el
.
textContent
.
trim
()).
toContain
(
'
2
'
);
it
(
'
shows group labels on group boards
'
,
done
=>
{
component
.
issue
.
addLabel
(
new
ListLabel
({
id
:
_
.
random
(
10000
),
title
:
'
Group label
'
,
type
:
'
GroupLabel
'
,
}),
);
component
.
groupId
=
1
;
Vue
.
nextTick
()
.
then
(()
=>
{
expect
(
component
.
$el
.
querySelectorAll
(
'
.badge
'
).
length
).
toBe
(
3
);
expect
(
component
.
$el
.
textContent
).
toContain
(
'
Group label
'
);
done
();
})
.
catch
(
done
.
fail
);
});
it
(
'
shows project labels on group boards
'
,
done
=>
{
component
.
issue
.
addLabel
(
new
ListLabel
({
id
:
123
,
title
:
'
Project label
'
,
type
:
'
ProjectLabel
'
,
}),
);
component
.
groupId
=
1
;
Vue
.
nextTick
()
.
then
(()
=>
{
expect
(
component
.
$el
.
querySelectorAll
(
'
.badge
'
).
length
).
toBe
(
3
);
expect
(
component
.
$el
.
textContent
).
toContain
(
'
Project label
'
);
done
();
})
.
catch
(
done
.
fail
);
});
});
});
spec/javascripts/boards/issue_card_spec.js
View file @
dc00a280
...
...
@@ -3,7 +3,6 @@
/* global ListIssue */
import
Vue
from
'
vue
'
;
import
_
from
'
underscore
'
;
import
'
~/vue_shared/models/label
'
;
import
'
~/vue_shared/models/assignee
'
;
...
...
@@ -56,14 +55,12 @@ describe('Issue card component', () => {
issue
,
issueLinkBase
:
'
/test
'
,
rootPath
:
'
/
'
,
groupId
:
null
,
};
},
template
:
`
<issue-card
:issue="issue"
:list="list"
:group-id="groupId"
:issue-link-base="issueLinkBase"
:root-path="rootPath"></issue-card>
`
,
...
...
@@ -287,47 +284,5 @@ describe('Issue card component', () => {
})
.
catch
(
done
.
fail
);
});
it
(
'
shows group labels on group boards
'
,
done
=>
{
component
.
issue
.
addLabel
(
new
ListLabel
({
id
:
_
.
random
(
10000
),
title
:
'
Group label
'
,
type
:
'
GroupLabel
'
,
}),
);
component
.
groupId
=
1
;
Vue
.
nextTick
()
.
then
(()
=>
{
expect
(
component
.
$el
.
querySelectorAll
(
'
.badge
'
).
length
).
toBe
(
3
);
expect
(
component
.
$el
.
textContent
).
toContain
(
'
Group label
'
);
done
();
})
.
catch
(
done
.
fail
);
});
it
(
'
shows project labels on group boards
'
,
done
=>
{
component
.
issue
.
addLabel
(
new
ListLabel
({
id
:
123
,
title
:
'
Project label
'
,
type
:
'
ProjectLabel
'
,
}),
);
component
.
groupId
=
1
;
Vue
.
nextTick
()
.
then
(()
=>
{
expect
(
component
.
$el
.
querySelectorAll
(
'
.badge
'
).
length
).
toBe
(
3
);
expect
(
component
.
$el
.
textContent
).
toContain
(
'
Project label
'
);
done
();
})
.
catch
(
done
.
fail
);
});
});
});
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