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
69de4417
Commit
69de4417
authored
Nov 12, 2021
by
Ezekiel Kigbo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds transfer project specs
Adds jest test for the transfer project form and updates the gitlab pot file.
parent
ebd6e5fe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
3 deletions
+72
-3
locale/gitlab.pot
locale/gitlab.pot
+3
-0
spec/features/projects/settings/user_transfers_a_project_spec.rb
...atures/projects/settings/user_transfers_a_project_spec.rb
+0
-2
spec/frontend/projects/settings/components/transfer_project_form_spec.js
...rojects/settings/components/transfer_project_form_spec.js
+68
-0
spec/frontend/vue_shared/components/namespace_select/namespace_select_spec.js
...ared/components/namespace_select/namespace_select_spec.js
+1
-1
No files found.
locale/gitlab.pot
View file @
69de4417
...
...
@@ -31535,6 +31535,9 @@ msgstr ""
msgid "Select a milestone"
msgstr ""
msgid "Select a namespace"
msgstr ""
msgid "Select a new namespace"
msgstr ""
...
...
spec/features/projects/settings/user_transfers_a_project_spec.rb
View file @
69de4417
...
...
@@ -16,11 +16,9 @@ RSpec.describe 'Projects > Settings > User transfers a project', :js do
visit
edit_project_path
(
project
)
page
.
within
(
'.js-project-transfer-form'
)
do
# page.find('.select2-container').click
page
.
find
(
'[data-testid="transfer-project-namespace"]'
).
click
end
# binding.pry
page
.
within
(
'[data-testid="transfer-project-namespace"]'
)
do
page
.
find
(
"li button"
,
text:
group
.
full_name
).
click
end
...
...
spec/frontend/projects/settings/components/transfer_project_form_spec.js
0 → 100644
View file @
69de4417
import
{
namespaces
}
from
'
jest/vue_shared/components/namespace_select/mock_data
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
TransferProjectForm
from
'
~/projects/settings/components/transfer_project_form.vue
'
;
import
NamespaceSelect
from
'
~/vue_shared/components/namespace_select/namespace_select.vue
'
;
import
ConfirmDanger
from
'
~/vue_shared/components/confirm_danger/confirm_danger.vue
'
;
describe
(
'
Transfer project form
'
,
()
=>
{
let
wrapper
;
const
confirmButtonText
=
'
Confirm
'
;
const
confirmationPhrase
=
'
You must construct additional pylons!
'
;
const
createComponent
=
()
=>
shallowMountExtended
(
TransferProjectForm
,
{
propsData
:
{
namespaces
,
confirmButtonText
,
confirmationPhrase
,
},
});
const
findNamespaceSelect
=
()
=>
wrapper
.
findComponent
(
NamespaceSelect
);
const
findConfirmDanger
=
()
=>
wrapper
.
findComponent
(
ConfirmDanger
);
beforeEach
(()
=>
{
wrapper
=
createComponent
();
});
afterEach
(()
=>
{
wrapper
.
destroy
();
});
it
(
'
renders the namespace selector
'
,
()
=>
{
expect
(
findNamespaceSelect
().
exists
()).
toBe
(
true
);
});
it
(
'
renders the confirm button
'
,
()
=>
{
expect
(
findConfirmDanger
().
exists
()).
toBe
(
true
);
});
it
(
'
disables the confirm button by default
'
,
()
=>
{
expect
(
findConfirmDanger
().
attributes
(
'
disabled
'
)).
toBe
(
'
true
'
);
});
describe
(
'
with a selected namespace
'
,
()
=>
{
const
[
selectedItem
]
=
namespaces
.
group
;
beforeEach
(()
=>
{
findNamespaceSelect
().
vm
.
$emit
(
'
select
'
,
selectedItem
);
});
it
(
'
emits the `selectNamespace` event when a namespace is selected
'
,
()
=>
{
const
args
=
[
selectedItem
.
id
];
expect
(
wrapper
.
emitted
(
'
selectNamespace
'
)).
toEqual
([
args
]);
});
it
(
'
enables the confirm button
'
,
()
=>
{
expect
(
findConfirmDanger
().
attributes
(
'
disabled
'
)).
toBeUndefined
();
});
it
(
'
clicking the confirm button emits the `confirm` event
'
,
()
=>
{
findConfirmDanger
().
vm
.
$emit
(
'
confirm
'
);
expect
(
wrapper
.
emitted
(
'
confirm
'
)).
toBeDefined
();
});
});
});
spec/frontend/vue_shared/components/namespace_select/namespace_select_spec.js
View file @
69de4417
import
{
GlDropdown
,
GlDropdownItem
,
GlDropdownSectionHeader
,
GlSearchBoxByType
}
from
'
@gitlab/ui
'
;
import
{
GlDropdown
,
GlDropdownItem
,
GlDropdownSectionHeader
}
from
'
@gitlab/ui
'
;
import
{
shallowMountExtended
}
from
'
helpers/vue_test_utils_helper
'
;
import
NamespaceSelect
,
{
i18n
,
...
...
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