Explorar o código

Correct dropdown name and change test to work with selection instead of checkbox

arvid-e hai 10 meses
pai
achega
adabbc3fb6

+ 2 - 2
apps/app/playwright/40-admin/access-to-admin-page.spec.ts

@@ -21,8 +21,8 @@ test('admin/security is successfully loaded', async({ page }) => {
   await page.goto('/admin/security');
 
   await expect(page.getByTestId('admin-security')).toBeVisible();
-  await expect(page.locator('#isShowRestrictedByOwner')).not.toBeChecked();
-  await expect(page.locator('#isShowRestrictedByGroup')).not.toBeChecked();
+  await expect(page.locator('#isShowRestrictedByOwner')).toHaveValue('Hidden');
+  await expect(page.locator('#isShowRestrictedByGroup')).toHaveValue('Hidden');
 });
 
 test('admin/markdown is successfully loaded', async({ page }) => {

+ 4 - 4
apps/app/src/client/components/Admin/Security/SecuritySetting.jsx

@@ -386,7 +386,7 @@ class SecuritySetting extends React.Component {
                     <button
                       className="btn btn-outline-secondary dropdown-toggle text-end col-12 col-md-auto"
                       type="button"
-                      id="ownerRestrictionDropdownButton"
+                      id="isShowRestrictedByOwner"
                       data-bs-toggle="dropdown"
                       aria-haspopup="true"
                       aria-expanded="true"
@@ -396,7 +396,7 @@ class SecuritySetting extends React.Component {
                         {adminGeneralSecurityContainer.state.currentOwnerRestrictionDisplayMode === 'Hidden' && t('security_settings.always_hidden')}
                       </span>
                     </button>
-                    <div className="dropdown-menu" aria-labelledby="ownerRestrictionDropdownButton">
+                    <div className="dropdown-menu" aria-labelledby="isShowRestrictedByOwner">
                       <button
                         className="dropdown-item"
                         type="button"
@@ -421,7 +421,7 @@ class SecuritySetting extends React.Component {
                     <button
                       className="btn btn-outline-secondary dropdown-toggle text-end col-12 col-md-auto"
                       type="button"
-                      id="groupRestrictionDropdownButton"
+                      id="isShowRestrictedByGroup"
                       data-bs-toggle="dropdown"
                       aria-haspopup="true"
                       aria-expanded="true"
@@ -431,7 +431,7 @@ class SecuritySetting extends React.Component {
                         {adminGeneralSecurityContainer.state.currentGroupRestrictionDisplayMode === 'Hidden' && t('security_settings.always_hidden')}
                       </span>
                     </button>
-                    <div className="dropdown-menu" aria-labelledby="groupRestrictionDropdownButton">
+                    <div className="dropdown-menu" aria-labelledby="isShowRestrictedByGroup">
                       <button
                         className="dropdown-item"
                         type="button"