Commit 8d36ef12 authored by Dan Davison's avatar Dan Davison

Merge branch 'fix-maven-toggle-settings' into 'master'

Fix allow settings for maven duplicates

See merge request gitlab-org/gitlab!56100
parents cd0b50a2 f12ca9e5
......@@ -79,12 +79,12 @@ export default {
<form>
<div class="gl-display-flex">
<gl-toggle
data-qa-selector="allow_duplicates_checkbox"
data-qa-selector="allow_duplicates_toggle"
:value="mavenDuplicatesAllowed"
@change="update($options.modelNames.MAVEN_DUPLICATES_ALLOWED, $event)"
/>
<div class="gl-ml-5">
<div data-testid="toggle-label">
<div data-testid="toggle-label" data-qa-selector="allow_duplicates_label">
<gl-sprintf :message="enabledButtonLabel">
<template #bold="{ content }">
<strong>{{ content }}</strong>
......
......@@ -12,18 +12,28 @@ module QA
end
view 'app/assets/javascripts/packages_and_registries/settings/group/components/maven_settings.vue' do
element :allow_duplicates_checkbox
element :allow_duplicates_toggle
element :allow_duplicates_label
end
def set_allow_duplicates_disabled
expand_content :package_registry_settings_content do
uncheck_element :allow_duplicates_checkbox
click_element(:allow_duplicates_toggle) if duplicates_enabled?
end
end
def has_allow_duplicates_enabled?
expand_content :package_registry_settings_content
!find_element(:allow_duplicates_checkbox).checked?
def set_allow_duplicates_enabled
expand_content :package_registry_settings_content do
click_element(:allow_duplicates_toggle) if duplicates_disabled?
end
end
def duplicates_enabled?
has_element?(:allow_duplicates_label, text: 'Allow duplicates')
end
def duplicates_disabled?
has_element?(:allow_duplicates_label, text: 'Do not allow duplicates')
end
end
end
......
......@@ -223,9 +223,7 @@ module QA
project.group.visit!
Page::Group::Menu.perform(&:go_to_package_settings)
Page::Group::Settings::PackageRegistries.perform do |settings|
expect(settings).to have_allow_duplicates_enabled
end
Page::Group::Settings::PackageRegistries.perform(&:set_allow_duplicates_enabled)
end
it 'allows users to publish duplicate Maven packages at the group level', testcase: 'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1722' do
......
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