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
bdbd9b3d
Commit
bdbd9b3d
authored
Oct 27, 2020
by
Russell Dickenson
Committed by
Enrique Alcántara
Oct 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Migrate button to GlButton in empty_state.vue
parent
8ce3a303
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
app/assets/javascripts/ide/components/terminal/empty_state.vue
...ssets/javascripts/ide/components/terminal/empty_state.vue
+8
-7
spec/frontend/ide/components/terminal/empty_state_spec.js
spec/frontend/ide/components/terminal/empty_state_spec.js
+10
-11
No files found.
app/assets/javascripts/ide/components/terminal/empty_state.vue
View file @
bdbd9b3d
<
script
>
<
script
>
/* eslint-disable vue/no-v-html */
/* eslint-disable vue/no-v-html */
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
,
GlButton
}
from
'
@gitlab/ui
'
;
export
default
{
export
default
{
components
:
{
components
:
{
GlLoadingIcon
,
GlLoadingIcon
,
GlButton
,
},
},
props
:
{
props
:
{
isLoading
:
{
isLoading
:
{
...
@@ -41,24 +42,24 @@ export default {
...
@@ -41,24 +42,24 @@ export default {
};
};
</
script
>
</
script
>
<
template
>
<
template
>
<div
class=
"
text-center p-3
"
>
<div
class=
"
gl-text-center gl-p-5
"
>
<div
v-if=
"illustrationPath"
class=
"svg-content svg-130"
><img
:src=
"illustrationPath"
/></div>
<div
v-if=
"illustrationPath"
class=
"svg-content svg-130"
><img
:src=
"illustrationPath"
/></div>
<h4>
{{
__
(
'
Web Terminal
'
)
}}
</h4>
<h4>
{{
__
(
'
Web Terminal
'
)
}}
</h4>
<gl-loading-icon
v-if=
"isLoading"
size=
"lg"
class=
"gl-mt-3"
/>
<gl-loading-icon
v-if=
"isLoading"
size=
"lg"
class=
"gl-mt-3"
/>
<template
v-else
>
<template
v-else
>
<p>
{{
__
(
'
Run tests against your code live using the Web Terminal
'
)
}}
</p>
<p>
{{
__
(
'
Run tests against your code live using the Web Terminal
'
)
}}
</p>
<p>
<p>
<button
<
gl-
button
:disabled=
"!isValid"
:disabled=
"!isValid"
c
lass=
"btn btn-info
"
c
ategory=
"primary
"
type=
"button
"
variant=
"info
"
data-qa-selector=
"start_web_terminal_button"
data-qa-selector=
"start_web_terminal_button"
@
click=
"onStart"
@
click=
"onStart"
>
>
{{
__
(
'
Start Web Terminal
'
)
}}
{{
__
(
'
Start Web Terminal
'
)
}}
</button>
</
gl-
button>
</p>
</p>
<div
v-if=
"!isValid && message"
class=
"bs-callout text-left"
v-html=
"message"
></div>
<div
v-if=
"!isValid && message"
class=
"bs-callout
gl-
text-left"
v-html=
"message"
></div>
<p
v-else
>
<p
v-else
>
<a
<a
v-if=
"helpPath"
v-if=
"helpPath"
...
...
spec/frontend/ide/components/terminal/empty_state_spec.js
View file @
bdbd9b3d
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
shallowMount
}
from
'
@vue/test-utils
'
;
import
{
GlLoadingIcon
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
,
GlButton
}
from
'
@gitlab/ui
'
;
import
{
TEST_HOST
}
from
'
spec/test_constants
'
;
import
{
TEST_HOST
}
from
'
spec/test_constants
'
;
import
TerminalEmptyState
from
'
~/ide/components/terminal/empty_state.vue
'
;
import
TerminalEmptyState
from
'
~/ide/components/terminal/empty_state.vue
'
;
...
@@ -36,7 +36,7 @@ describe('IDE TerminalEmptyState', () => {
...
@@ -36,7 +36,7 @@ describe('IDE TerminalEmptyState', () => {
const
img
=
wrapper
.
find
(
'
.svg-content img
'
);
const
img
=
wrapper
.
find
(
'
.svg-content img
'
);
expect
(
img
.
exists
()).
toBe
(
true
);
expect
(
img
.
exists
()).
toBe
(
true
);
expect
(
img
.
attributes
(
'
src
'
)).
to
Equal
(
TEST_PATH
);
expect
(
img
.
attributes
(
'
src
'
)).
to
Be
(
TEST_PATH
);
});
});
it
(
'
when loading, shows loading icon
'
,
()
=>
{
it
(
'
when loading, shows loading icon
'
,
()
=>
{
...
@@ -71,24 +71,23 @@ describe('IDE TerminalEmptyState', () => {
...
@@ -71,24 +71,23 @@ describe('IDE TerminalEmptyState', () => {
},
},
});
});
button
=
wrapper
.
find
(
'
button
'
);
button
=
wrapper
.
find
(
GlButton
);
});
});
it
(
'
shows button
'
,
()
=>
{
it
(
'
shows button
'
,
()
=>
{
expect
(
button
.
text
()).
to
Equal
(
'
Start Web Terminal
'
);
expect
(
button
.
text
()).
to
Be
(
'
Start Web Terminal
'
);
expect
(
button
.
attributes
(
'
disabled
'
)).
toBeFalsy
(
);
expect
(
button
.
props
(
'
disabled
'
)).
toBe
(
false
);
});
});
it
(
'
emits start when button is clicked
'
,
()
=>
{
it
(
'
emits start when button is clicked
'
,
()
=>
{
expect
(
wrapper
.
emitted
().
start
).
toBeFalsy
();
expect
(
wrapper
.
emitted
().
start
).
toBeUndefined
();
button
.
vm
.
$emit
(
'
click
'
);
button
.
trigger
(
'
click
'
);
expect
(
wrapper
.
emitted
().
start
).
toHaveLength
(
1
);
expect
(
wrapper
.
emitted
().
start
).
toHaveLength
(
1
);
});
});
it
(
'
shows help path link
'
,
()
=>
{
it
(
'
shows help path link
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
a
'
).
attributes
(
'
href
'
)).
to
Equal
(
TEST_HELP_PATH
);
expect
(
wrapper
.
find
(
'
a
'
).
attributes
(
'
href
'
)).
to
Be
(
TEST_HELP_PATH
);
});
});
});
});
...
@@ -101,7 +100,7 @@ describe('IDE TerminalEmptyState', () => {
...
@@ -101,7 +100,7 @@ describe('IDE TerminalEmptyState', () => {
},
},
});
});
expect
(
wrapper
.
find
(
'
button
'
).
attributes
(
'
disabled
'
)).
not
.
toBe
(
null
);
expect
(
wrapper
.
find
(
GlButton
).
props
(
'
disabled
'
)).
toBe
(
true
);
expect
(
wrapper
.
find
(
'
.bs-callout
'
).
element
.
innerHTML
).
to
Equal
(
TEST_HTML_MESSAGE
);
expect
(
wrapper
.
find
(
'
.bs-callout
'
).
element
.
innerHTML
).
to
Be
(
TEST_HTML_MESSAGE
);
});
});
});
});
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