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
55c172c1
Commit
55c172c1
authored
Dec 10, 2020
by
Illya Klymov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Address reviewer comments
- improve readability - switch to toHaveLength - improve feature spec
parent
b35e51e2
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
8 deletions
+22
-8
app/assets/javascripts/import_entities/import_groups/components/import_table_row.vue
...rt_entities/import_groups/components/import_table_row.vue
+2
-1
spec/features/groups/import_export/connect_instance_spec.rb
spec/features/groups/import_export/connect_instance_spec.rb
+14
-0
spec/frontend/import_entities/import_groups/components/import_table_spec.js
...rt_entities/import_groups/components/import_table_spec.js
+1
-1
spec/frontend/import_entities/import_groups/graphql/client_factory_spec.js
...ort_entities/import_groups/graphql/client_factory_spec.js
+5
-6
No files found.
app/assets/javascripts/import_entities/import_groups/components/import_table_row.vue
View file @
55c172c1
<
script
>
<
script
>
import
{
GlButton
,
GlIcon
,
GlLink
,
GlFormInput
}
from
'
@gitlab/ui
'
;
import
{
GlButton
,
GlIcon
,
GlLink
,
GlFormInput
}
from
'
@gitlab/ui
'
;
import
{
joinPaths
}
from
'
~/lib/utils/url_utility
'
;
import
Select2Select
from
'
~/vue_shared/components/select2_select.vue
'
;
import
Select2Select
from
'
~/vue_shared/components/select2_select.vue
'
;
import
ImportStatus
from
'
../../components/import_status.vue
'
;
import
ImportStatus
from
'
../../components/import_status.vue
'
;
import
{
STATUSES
}
from
'
../../constants
'
;
import
{
STATUSES
}
from
'
../../constants
'
;
...
@@ -47,7 +48,7 @@ export default {
...
@@ -47,7 +48,7 @@ export default {
},
},
getFullPath
(
group
)
{
getFullPath
(
group
)
{
return
`
${
gon
.
relative_url_root
||
''
}
/
${
this
.
getPath
(
group
)}
`
;
return
joinPaths
(
gon
.
relative_url_root
||
'
/
'
,
this
.
getPath
(
group
))
;
},
},
},
},
};
};
...
...
spec/features/groups/import_export/connect_instance_spec.rb
View file @
55c172c1
...
@@ -22,6 +22,19 @@ RSpec.describe 'Import/Export - Connect to another instance', :js do
...
@@ -22,6 +22,19 @@ RSpec.describe 'Import/Export - Connect to another instance', :js do
it
'successfully connects to remote instance'
do
it
'successfully connects to remote instance'
do
source_url
=
'https://gitlab.com'
source_url
=
'https://gitlab.com'
pat
=
'demo-pat'
pat
=
'demo-pat'
stub_path
=
'stub-group'
stub_request
(
:get
,
"%{url}/api/v4/groups?page=1&per_page=30&top_level_only=true"
%
{
url:
source_url
}).
to_return
(
body:
[{
id:
2595438
,
web_url:
'https://gitlab.com/groups/auto-breakfast'
,
name:
'Stub'
,
path:
stub_path
,
full_name:
'Stub'
,
full_path:
stub_path
}].
to_json
,
headers:
{
'Content-Type'
=>
'application/json'
}
)
expect
(
page
).
to
have_content
'Import groups from another instance of GitLab'
expect
(
page
).
to
have_content
'Import groups from another instance of GitLab'
...
@@ -31,6 +44,7 @@ RSpec.describe 'Import/Export - Connect to another instance', :js do
...
@@ -31,6 +44,7 @@ RSpec.describe 'Import/Export - Connect to another instance', :js do
click_on
'Connect instance'
click_on
'Connect instance'
expect
(
page
).
to
have_content
'Importing groups from %{url}'
%
{
url:
source_url
}
expect
(
page
).
to
have_content
'Importing groups from %{url}'
%
{
url:
source_url
}
expect
(
page
).
to
have_content
stub_path
end
end
end
end
...
...
spec/frontend/import_entities/import_groups/components/import_table_spec.js
View file @
55c172c1
...
@@ -72,7 +72,7 @@ describe('import table', () => {
...
@@ -72,7 +72,7 @@ describe('import table', () => {
});
});
await
waitForPromises
();
await
waitForPromises
();
expect
(
wrapper
.
findAll
(
ImportTableRow
)
.
length
).
toBe
(
FAKE_GROUPS
.
length
);
expect
(
wrapper
.
findAll
(
ImportTableRow
)
).
toHaveLength
(
FAKE_GROUPS
.
length
);
});
});
describe
(
'
converts row events to mutation invocations
'
,
()
=>
{
describe
(
'
converts row events to mutation invocations
'
,
()
=>
{
...
...
spec/frontend/import_entities/import_groups/graphql/client_factory_spec.js
View file @
55c172c1
...
@@ -56,12 +56,11 @@ describe('Bulk import resolvers', () => {
...
@@ -56,12 +56,11 @@ describe('Bulk import resolvers', () => {
});
});
it
(
'
mirrors REST endpoint response fields
'
,
()
=>
{
it
(
'
mirrors REST endpoint response fields
'
,
()
=>
{
const
MIRRORED_FIELDS
=
[
'
id
'
,
'
full_path
'
];
const
extractRelevantFields
=
obj
=>
({
id
:
obj
.
id
,
full_path
:
obj
.
full_path
});
expect
(
results
.
every
((
r
,
idx
)
=>
expect
(
results
.
map
(
extractRelevantFields
)).
toStrictEqual
(
MIRRORED_FIELDS
.
every
(
field
=>
r
[
field
]
===
availableNamespacesFixture
[
idx
][
field
]),
availableNamespacesFixture
.
map
(
extractRelevantFields
),
),
);
).
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