Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1869 from vitoravelino/fix-team-field
Browse files Browse the repository at this point in the history
ui: fixed team field on namespaces#index
  • Loading branch information
mssola committed Jun 29, 2018
2 parents 1eb9c58 + 040beab commit afcb483
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/namespaces/components/_form.html.slim
Expand Up @@ -13,7 +13,7 @@ div ref="form" class="collapse"
span.error-message v-for="(error, index) in errors.name" :key="index"
| Name {{ error }}

.form-group.has-feedback :class=="{ 'has-error': $v.namespace.team.$error }" v-if="!namespace.team"
.form-group.has-feedback :class=="{ 'has-error': $v.namespace.team.$error }" v-if="!teamName"
= f.label :team, { class: "control-label col-md-2" }
.col-md-7
vue-multiselect{
Expand Down
11 changes: 11 additions & 0 deletions spec/features/namespaces_spec.rb
Expand Up @@ -49,6 +49,17 @@
expect(page).to have_button("Create", disabled: true)
end

# TODO: move this test to a component level one instead of feature once
# form component is migrated to a vue file
it "shows team field if no team", js: true do
visit namespaces_path

find(".toggle-link-new-namespace").click
wait_for_effect_on("#new-namespace-form")

expect(page).to have_css(".namespace_team")
end

it "An user cannot create a namespace that already exists", js: true do
visit namespaces_path

Expand Down
9 changes: 9 additions & 0 deletions spec/features/teams_spec.rb
Expand Up @@ -172,6 +172,15 @@
visit team_path(team)
end

# TODO: move this test to a component level one instead of feature once
# form component is migrated to a vue file
it "hides team field if team is defined", js: true do
find(".toggle-link-new-namespace").click

expect(page).to have_css("#namespace_name")
expect(page).not_to have_css(".namespace_team")
end

it "A namespace can be created from the team page", js: true do
namespaces_count = Namespace.count

Expand Down

0 comments on commit afcb483

Please sign in to comment.