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
c3c467e8
Commit
c3c467e8
authored
Sep 13, 2019
by
Paul Slaughter
Committed by
Mike Greiling
Sep 13, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flaky issue card spec
parent
ae60c6c0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
102 additions
and
121 deletions
+102
-121
ee/spec/frontend/boards/issue_card_spec.js
ee/spec/frontend/boards/issue_card_spec.js
+99
-0
ee/spec/javascripts/boards/issue_card_spec.js
ee/spec/javascripts/boards/issue_card_spec.js
+0
-121
jest.config.js
jest.config.js
+3
-0
No files found.
ee/spec/frontend/boards/issue_card_spec.js
0 → 100644
View file @
c3c467e8
import
{
mount
}
from
'
@vue/test-utils
'
;
import
ListLabel
from
'
~/boards/models/label
'
;
import
IssueCardInner
from
'
~/boards/components/issue_card_inner.vue
'
;
import
IssueCardWeight
from
'
ee/boards/components/issue_card_weight.vue
'
;
import
ListIssueEE
from
'
ee/boards/models/issue
'
;
describe
(
'
Issue card component
'
,
()
=>
{
let
wrapper
;
let
issue
;
let
list
;
const
createComponent
=
(
props
=
{})
=>
{
wrapper
=
mount
(
IssueCardInner
,
{
propsData
:
{
list
,
issue
,
groupId
:
null
,
rootPath
:
'
/
'
,
issueLinkBase
:
'
/test
'
,
...
props
,
},
sync
:
false
,
});
};
beforeEach
(()
=>
{
list
=
{
id
:
300
,
position
:
0
,
title
:
'
Test
'
,
list_type
:
'
label
'
,
label
:
{
id
:
5000
,
title
:
'
Testing
'
,
color
:
'
red
'
,
description
:
'
testing;
'
,
textColor
:
'
white
'
,
},
};
issue
=
new
ListIssueEE
({
title
:
'
Testing
'
,
id
:
1
,
iid
:
1
,
confidential
:
false
,
labels
:
[
list
.
label
],
assignees
:
[],
reference_path
:
'
#1
'
,
real_path
:
'
/test/1
'
,
weight
:
1
,
});
});
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
=
null
;
});
describe
(
'
labels
'
,
()
=>
{
beforeEach
(()
=>
{
const
label1
=
new
ListLabel
({
id
:
3
,
title
:
'
testing 123
'
,
color
:
'
blue
'
,
text_color
:
'
white
'
,
description
:
'
test
'
,
});
issue
.
addLabel
(
label1
);
});
it
.
each
`
type | title | desc
${
'
GroupLabel
'
}
|
${
'
Group label
'
}
|
${
'
shows group labels on group boards
'
}
${
'
ProjectLabel
'
}
|
${
'
Project label
'
}
|
${
'
shows project labels on group boards
'
}
`
(
'
$desc
'
,
({
type
,
title
})
=>
{
issue
.
addLabel
(
new
ListLabel
({
id
:
9001
,
type
,
title
,
}),
);
createComponent
({
groupId
:
1
});
expect
(
wrapper
.
findAll
(
'
.badge
'
).
length
).
toBe
(
3
);
expect
(
wrapper
.
text
()).
toContain
(
title
);
});
});
describe
(
'
weight
'
,
()
=>
{
it
(
'
shows weight component
'
,
()
=>
{
createComponent
();
expect
(
wrapper
.
find
(
IssueCardWeight
).
exists
()).
toBe
(
true
);
});
});
});
ee/spec/javascripts/boards/issue_card_spec.js
deleted
100644 → 0
View file @
ae60c6c0
/* global ListLabel */
import
Vue
from
'
vue
'
;
import
_
from
'
underscore
'
;
import
'
~/boards/models/label
'
;
import
'
~/boards/models/assignee
'
;
import
'
~/boards/models/list
'
;
import
IssueCardInner
from
'
~/boards/components/issue_card_inner.vue
'
;
import
{
listObj
}
from
'
spec/boards/mock_data
'
;
import
ListIssueEE
from
'
ee/boards/models/issue
'
;
describe
(
'
Issue card component
'
,
()
=>
{
const
label1
=
new
ListLabel
({
id
:
3
,
title
:
'
testing 123
'
,
color
:
'
blue
'
,
text_color
:
'
white
'
,
description
:
'
test
'
,
});
let
component
;
let
issue
;
let
list
;
beforeEach
(()
=>
{
setFixtures
(
'
<div class="test-container"></div>
'
);
list
=
listObj
;
issue
=
new
ListIssueEE
({
title
:
'
Testing
'
,
id
:
1
,
iid
:
1
,
confidential
:
false
,
labels
:
[
list
.
label
],
assignees
:
[],
reference_path
:
'
#1
'
,
real_path
:
'
/test/1
'
,
weight
:
1
,
});
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>
`
,
});
});
describe
(
'
labels
'
,
()
=>
{
beforeEach
(
done
=>
{
component
.
issue
.
addLabel
(
label1
);
Vue
.
nextTick
(()
=>
done
());
});
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
);
});
});
describe
(
'
weights
'
,
()
=>
{
it
(
'
shows weight component
'
,
()
=>
{
expect
(
component
.
$el
.
querySelector
(
'
.board-card-weight
'
)).
not
.
toBeNull
();
});
});
});
jest.config.js
View file @
c3c467e8
...
...
@@ -31,6 +31,9 @@ module.exports = {
moduleNameMapper
:
{
'
^~(/.*)$
'
:
'
<rootDir>/app/assets/javascripts$1
'
,
'
^ee(/.*)$
'
:
'
<rootDir>/ee/app/assets/javascripts$1
'
,
'
^ee_component(/.*)$
'
:
IS_EE
?
'
<rootDir>/ee/app/assets/javascripts$1
'
:
'
<rootDir>/app/assets/javascripts/vue_shared/components/empty_component.js
'
,
'
^ee_else_ce(/.*)$
'
:
IS_EE
?
'
<rootDir>/ee/app/assets/javascripts$1
'
:
'
<rootDir>/app/assets/javascripts$1
'
,
...
...
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