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
acfdcca4
Commit
acfdcca4
authored
Jul 05, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
component spec
parent
e241fe6b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
125 additions
and
0 deletions
+125
-0
app/assets/javascripts/ide/components/panes/right.vue
app/assets/javascripts/ide/components/panes/right.vue
+2
-0
spec/javascripts/ide/components/merge_requests/info_spec.js
spec/javascripts/ide/components/merge_requests/info_spec.js
+51
-0
spec/javascripts/ide/components/panes/right_spec.js
spec/javascripts/ide/components/panes/right_spec.js
+72
-0
No files found.
app/assets/javascripts/ide/components/panes/right.vue
View file @
acfdcca4
...
...
@@ -62,6 +62,7 @@ export default {
<button
v-tooltip
:title=
"__('Merge Request')"
:aria-label=
"__('Merge Request')"
:class=
"
{
active: rightPane === $options.rightSidebarViews.mergeRequestInfo
}"
...
...
@@ -81,6 +82,7 @@ export default {
<button
v-tooltip
:title=
"__('Pipelines')"
:aria-label=
"__('Pipelines')"
:class=
"
{
active: pipelinesActive
}"
...
...
spec/javascripts/ide/components/merge_requests/info_spec.js
0 → 100644
View file @
acfdcca4
import
Vue
from
'
vue
'
;
import
'
~/behaviors/markdown/render_gfm
'
;
import
{
createStore
}
from
'
~/ide/stores
'
;
import
Info
from
'
~/ide/components/merge_requests/info.vue
'
;
import
{
createComponentWithStore
}
from
'
../../../helpers/vue_mount_component_helper
'
;
describe
(
'
IDE merge request details
'
,
()
=>
{
let
Component
;
let
vm
;
beforeAll
(()
=>
{
Component
=
Vue
.
extend
(
Info
);
});
beforeEach
(()
=>
{
const
store
=
createStore
();
store
.
state
.
currentProjectId
=
'
gitlab-ce
'
;
store
.
state
.
currentMergeRequestId
=
1
;
store
.
state
.
projects
[
'
gitlab-ce
'
]
=
{
mergeRequests
:
{
1
:
{
iid
:
1
,
title
:
'
Testing
'
,
title_html
:
'
<span class="title-html">Testing</span>
'
,
description
:
'
Description
'
,
description_html
:
'
<p class="description-html">Description HTML</p>
'
,
},
},
};
vm
=
createComponentWithStore
(
Component
,
store
).
$mount
();
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
it
(
'
renders merge request IID
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.detail-page-header
'
).
textContent
).
toContain
(
'
!1
'
);
});
it
(
'
renders title as HTML
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.title-html
'
)).
not
.
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.title
'
).
textContent
).
toContain
(
'
Testing
'
);
});
it
(
'
renders description as HTML
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.description-html
'
)).
not
.
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.description
'
).
textContent
).
toContain
(
'
Description HTML
'
);
});
});
spec/javascripts/ide/components/panes/right_spec.js
0 → 100644
View file @
acfdcca4
import
Vue
from
'
vue
'
;
import
'
~/behaviors/markdown/render_gfm
'
;
import
{
createStore
}
from
'
~/ide/stores
'
;
import
RightPane
from
'
~/ide/components/panes/right.vue
'
;
import
{
rightSidebarViews
}
from
'
~/ide/constants
'
;
import
{
createComponentWithStore
}
from
'
../../../helpers/vue_mount_component_helper
'
;
describe
(
'
IDE right pane
'
,
()
=>
{
let
Component
;
let
vm
;
beforeAll
(()
=>
{
Component
=
Vue
.
extend
(
RightPane
);
});
beforeEach
(()
=>
{
const
store
=
createStore
();
vm
=
createComponentWithStore
(
Component
,
store
).
$mount
();
});
afterEach
(()
=>
{
vm
.
$destroy
();
});
describe
(
'
active
'
,
()
=>
{
it
(
'
renders merge request button as active
'
,
done
=>
{
vm
.
$store
.
state
.
rightPane
=
rightSidebarViews
.
mergeRequestInfo
;
vm
.
$store
.
state
.
currentMergeRequestId
=
'
123
'
;
vm
.
$store
.
state
.
currentProjectId
=
'
gitlab-ce
'
;
vm
.
$store
.
state
.
currentMergeRequestId
=
1
;
vm
.
$store
.
state
.
projects
[
'
gitlab-ce
'
]
=
{
mergeRequests
:
{
1
:
{
iid
:
1
,
title
:
'
Testing
'
,
title_html
:
'
<span class="title-html">Testing</span>
'
,
description
:
'
Description
'
,
description_html
:
'
<p class="description-html">Description HTML</p>
'
,
},
},
};
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.ide-sidebar-link.active
'
)).
not
.
toBe
(
null
);
expect
(
vm
.
$el
.
querySelector
(
'
.ide-sidebar-link.active
'
).
getAttribute
(
'
data-original-title
'
),
).
toBe
(
'
Merge Request
'
);
done
();
});
});
});
describe
(
'
click
'
,
()
=>
{
beforeEach
(()
=>
{
spyOn
(
vm
,
'
setRightPane
'
);
});
it
(
'
sets view to merge request
'
,
done
=>
{
vm
.
$store
.
state
.
currentMergeRequestId
=
'
123
'
;
vm
.
$nextTick
(()
=>
{
vm
.
$el
.
querySelector
(
'
.ide-sidebar-link
'
).
click
();
expect
(
vm
.
setRightPane
).
toHaveBeenCalledWith
(
rightSidebarViews
.
mergeRequestInfo
);
done
();
});
});
});
});
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