Commit 4e88386b authored by Ezekiel Kigbo's avatar Ezekiel Kigbo

Fix feature specs

parent eb0f66df
......@@ -11,9 +11,10 @@ export default () => {
phrase,
buttonText,
confirmDangerMessage,
testId = null,
testid = null,
disabled = false,
} = el.dataset;
return new Vue({
el,
provide: {
......@@ -24,7 +25,7 @@ export default () => {
props: {
phrase,
buttonText,
testId,
testid,
disabled: parseBoolean(disabled),
},
on: {
......
......@@ -26,7 +26,7 @@ export default {
type: String,
required: true,
},
testId: {
testid: {
type: String,
required: false,
default: 'confirm-danger-button',
......@@ -42,7 +42,7 @@ export default {
class="gl-button"
variant="danger"
:disabled="disabled"
:data-testid="testId"
:data-testid="testid"
>{{ buttonText }}</gl-button
>
<confirm-danger-modal
......
......@@ -93,6 +93,7 @@ export default {
</p>
<gl-form-group :state="isValid" :invalid-feedback="$options.i18n.CONFIRM_DANGER_MODAL_ERROR">
<gl-form-input
id="confirm_name_input"
v-model="confirmationPhrase"
class="form-control"
data-testid="confirm-danger-input"
......
- remove_form_id = local_assigns.fetch(:remove_form_id, nil)
- confirm_modal_data = { "remove_form_id" => remove_form_id, "disabled" => group.paid?, "button-text" => _('Remove group'), "confirm-danger-message" => remove_group_message(group), phrase: group.full_path, 'testid' => 'remove-group-button' }
- confirm_modal_data = { "remove_form_id" => remove_form_id, "disabled" => group.paid?.to_s, "button-text" => _('Remove group'), "confirm-danger-message" => remove_group_message(group), phrase: group.full_path, 'testid' => 'remove-group-button' }
- if group.paid?
.gl-alert.gl-alert-info.gl-mb-5{ data: { testid: 'group-has-linked-subscription-alert' } }
......
......@@ -10,7 +10,7 @@ RSpec.describe 'groups/settings/_remove.html.haml' do
render 'groups/settings/remove', group: group
expect(rendered).to have_selector '[data-testid="remove-group-button"]'
expect(rendered).not_to have_selector '[data-testid="remove-group-button"].disabled'
expect(rendered).not_to match 'data-disabled="true"'
expect(rendered).not_to have_selector '[data-testid="group-has-linked-subscription-alert"]'
end
......@@ -19,7 +19,8 @@ RSpec.describe 'groups/settings/_remove.html.haml' do
render 'groups/settings/remove', group: group
expect(rendered).to have_selector '[data-testid="remove-group-button"].disabled'
expect(rendered).to have_selector '[data-testid="remove-group-button"]'
expect(rendered).to match 'data-disabled="true"'
expect(rendered).to have_selector '[data-testid="group-has-linked-subscription-alert"]'
end
......@@ -28,7 +29,8 @@ RSpec.describe 'groups/settings/_remove.html.haml' do
render 'groups/settings/remove', group: group
expect(rendered).to have_selector '[data-testid="remove-group-button"].disabled'
expect(rendered).to have_selector '[data-testid="remove-group-button"]'
expect(rendered).to match 'data-disabled="true"'
expect(rendered).to have_selector '[data-testid="group-has-linked-subscription-alert"]'
end
......@@ -39,7 +41,7 @@ RSpec.describe 'groups/settings/_remove.html.haml' do
render 'groups/settings/remove', group: subgroup
expect(rendered).to have_selector '[data-testid="remove-group-button"]'
expect(rendered).not_to have_selector '[data-testid="remove-group-button"].disabled'
expect(rendered).not_to match 'data-disabled="true"'
expect(rendered).not_to have_selector '[data-testid="group-has-linked-subscription-alert"]'
end
......@@ -52,7 +54,7 @@ RSpec.describe 'groups/settings/_remove.html.haml' do
render 'groups/settings/remove', group: group
expect(rendered).to have_selector '[data-testid="remove-group-button"]'
expect(rendered).not_to have_selector '[data-testid="remove-group-button"].disabled'
expect(rendered).not_to match 'data-disabled="true"'
expect(rendered).not_to have_selector '[data-testid="group-has-linked-subscription-alert"]'
end
......@@ -61,7 +63,8 @@ RSpec.describe 'groups/settings/_remove.html.haml' do
render 'groups/settings/remove', group: group
expect(rendered).to have_selector '[data-testid="remove-group-button"].disabled'
expect(rendered).to have_selector '[data-testid="remove-group-button"]'
expect(rendered).to match 'data-disabled="true"'
expect(rendered).to have_selector '[data-testid="group-has-linked-subscription-alert"]'
end
......@@ -72,7 +75,7 @@ RSpec.describe 'groups/settings/_remove.html.haml' do
render 'groups/settings/remove', group: subgroup
expect(rendered).to have_selector '[data-testid="remove-group-button"]'
expect(rendered).not_to have_selector '[data-testid="remove-group-button"].disabled'
expect(rendered).not_to match 'data-disabled="true"'
expect(rendered).not_to have_selector '[data-testid="group-has-linked-subscription-alert"]'
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment