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
78aa9892
Commit
78aa9892
authored
Jan 13, 2021
by
Miguel Rincon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trigger empty state only for missing file case
parent
330f7577
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
12 deletions
+9
-12
app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue
...ssets/javascripts/pipeline_editor/pipeline_editor_app.vue
+1
-1
spec/frontend/pipeline_editor/pipeline_editor_app_spec.js
spec/frontend/pipeline_editor/pipeline_editor_app_spec.js
+8
-11
No files found.
app/assets/javascripts/pipeline_editor/pipeline_editor_app.vue
View file @
78aa9892
...
...
@@ -126,7 +126,7 @@ export default {
return
this
.
$apollo
.
queries
.
content
.
loading
;
},
isBlobContentError
()
{
return
this
.
failureType
===
LOAD_FAILURE_NO_FILE
||
this
.
failureType
===
LOAD_FAILURE_UNKNOWN
;
return
this
.
failureType
===
LOAD_FAILURE_NO_FILE
;
},
isCiConfigDataLoading
()
{
return
this
.
$apollo
.
queries
.
ciConfigData
.
loading
;
...
...
spec/frontend/pipeline_editor/pipeline_editor_app_spec.js
View file @
78aa9892
...
...
@@ -448,16 +448,7 @@ describe('~/pipeline_editor/pipeline_editor_app.vue', () => {
const
expectedAlertMsg
=
'
There is no .gitlab-ci.yml file in this repository, please add one and visit the Pipeline Editor again.
'
;
it
(
'
does not show editor or commit form
'
,
async
()
=>
{
mockBlobContentData
.
mockRejectedValueOnce
(
new
Error
(
'
My error!
'
));
createComponentWithApollo
();
await
waitForPromises
();
expect
(
findEditorLite
().
exists
()).
toBe
(
false
);
expect
(
findTextEditor
().
exists
()).
toBe
(
false
);
});
it
(
'
shows a 404 error message
'
,
async
()
=>
{
it
(
'
shows a 404 error message and does not show editor or commit form
'
,
async
()
=>
{
mockBlobContentData
.
mockRejectedValueOnce
({
response
:
{
status
:
httpStatusCodes
.
NOT_FOUND
,
...
...
@@ -468,9 +459,11 @@ describe('~/pipeline_editor/pipeline_editor_app.vue', () => {
await
waitForPromises
();
expect
(
findAlert
().
text
()).
toBe
(
expectedAlertMsg
);
expect
(
findEditorLite
().
exists
()).
toBe
(
false
);
expect
(
findTextEditor
().
exists
()).
toBe
(
false
);
});
it
(
'
shows a 400 error message
'
,
async
()
=>
{
it
(
'
shows a 400 error message
and does not show editor or commit form
'
,
async
()
=>
{
mockBlobContentData
.
mockRejectedValueOnce
({
response
:
{
status
:
httpStatusCodes
.
BAD_REQUEST
,
...
...
@@ -481,6 +474,8 @@ describe('~/pipeline_editor/pipeline_editor_app.vue', () => {
await
waitForPromises
();
expect
(
findAlert
().
text
()).
toBe
(
expectedAlertMsg
);
expect
(
findEditorLite
().
exists
()).
toBe
(
false
);
expect
(
findTextEditor
().
exists
()).
toBe
(
false
);
});
it
(
'
shows a unkown error message
'
,
async
()
=>
{
...
...
@@ -489,6 +484,8 @@ describe('~/pipeline_editor/pipeline_editor_app.vue', () => {
await
waitForPromises
();
expect
(
findAlert
().
text
()).
toBe
(
'
The CI configuration was not loaded, please try again.
'
);
expect
(
findEditorLite
().
exists
()).
toBe
(
true
);
expect
(
findTextEditor
().
exists
()).
toBe
(
true
);
});
});
});
...
...
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