diff --git a/.eslintrc.yml b/.eslintrc.yml index 85c40e7ec05b36b813e03ee3950315187b028e72..ae0d46109274c1e694353f7886cbe1cc21a2ddf0 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -28,11 +28,11 @@ rules: import/no-unresolved: - error - ignore: - # In FOSS, these import paths are rewritten using - # NormalModuleReplacementPlugin, which import/no-unresolved doesn't - # consider. See - # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89831. - - '^(ee|jh)_component/' + # In FOSS, these import paths are rewritten using + # NormalModuleReplacementPlugin, which import/no-unresolved doesn't + # consider. See + # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/89831. + - '^(ee|jh)_component/' # Disabled for now, to make the airbnb-base 12.1.0 -> 13.1.0 update smoother no-else-return: - error @@ -48,12 +48,12 @@ rules: '@gitlab/vue-no-new-non-primitive-in-template': - error - allowNames: - - 'class(es)?$' - - '^style$' - - '^to$' - - '^$' - - '^variables$' - - 'attrs?$' + - 'class(es)?$' + - '^style$' + - '^to$' + - '^$' + - '^variables$' + - 'attrs?$' no-param-reassign: - error - props: true @@ -120,8 +120,8 @@ rules: no-restricted-imports: - error - paths: - - name: mousetrap - message: "Import { Mousetrap } from ~/lib/mousetrap instead." + - name: mousetrap + message: 'Import { Mousetrap } from ~/lib/mousetrap instead.' # See https://gitlab.com/gitlab-org/gitlab/-/issues/360551 vue/multi-word-component-names: off unicorn/prefer-dom-node-dataset: @@ -136,7 +136,7 @@ rules: methods: 'sanitize' overrides: - files: - - '{,ee/,jh/}spec/frontend*/**/*' + - '{,ee/,jh/}spec/frontend*/**/*' rules: '@gitlab/require-i18n-strings': off '@gitlab/no-runtime-template-compiler': off @@ -153,6 +153,8 @@ overrides: message: 'Prefer explicit waitForPromises (or equivalent), or jest.runAllTimers (or equivalent) to vague setImmediate calls.' - selector: ImportSpecifier[imported.name='GlSkeletonLoading'] message: 'Migrate to GlSkeletonLoader, or import GlDeprecatedSkeletonLoading.' + - selector: CallExpression[arguments.length=1][arguments.0.type='Literal'] CallExpression[callee.property.name='toBe'] CallExpression[callee.property.name='attributes'][arguments.length=1][arguments.0.value='disabled'] + message: Avoid asserting disabled attribute exact value, because Vue.js 2 and Vue.js 3 renders it differently. Use toBeDefined / toBeUndefined instead no-unsanitized/method: off no-unsanitized/property: off - files: @@ -198,6 +200,6 @@ overrides: '@graphql-eslint/no-unused-fragments': error '@graphql-eslint/no-duplicate-fields': error - files: - - '{,ee/}spec/contracts/consumer/**/*' + - '{,ee/}spec/contracts/consumer/**/*' rules: '@gitlab/require-i18n-strings': off diff --git a/ee/spec/frontend/admin/application_settings/deletion_protection/components/form_group_spec.js b/ee/spec/frontend/admin/application_settings/deletion_protection/components/form_group_spec.js index 52ee23e6e02d12eb30bb12be0b38ce3488ef2a89..9568201ef13dae2a13ff1aa140cfac10970ce759 100644 --- a/ee/spec/frontend/admin/application_settings/deletion_protection/components/form_group_spec.js +++ b/ee/spec/frontend/admin/application_settings/deletion_protection/components/form_group_spec.js @@ -184,8 +184,8 @@ describe('Form group component', () => { it('disables the "Keep deleted" input fields', () => { createComponent(); - expect(findSelectProjectRemoval().attributes('disabled')).toBe('true'); - expect(findAdjournedPeriodInput().attributes('disabled')).toBe('true'); + expect(findSelectProjectRemoval().attributes('disabled')).toBeDefined(); + expect(findAdjournedPeriodInput().attributes('disabled')).toBeDefined(); }); it('selects the "groups only" option', () => { diff --git a/ee/spec/frontend/admin/application_settings/reporting/git_abuse_settings/components/settings_form_spec.js b/ee/spec/frontend/admin/application_settings/reporting/git_abuse_settings/components/settings_form_spec.js index 81ff919c969147fadbc98f8819a6131181686381..f14ac77b7db4e77b1e49f41cd8b996e14a106090 100644 --- a/ee/spec/frontend/admin/application_settings/reporting/git_abuse_settings/components/settings_form_spec.js +++ b/ee/spec/frontend/admin/application_settings/reporting/git_abuse_settings/components/settings_form_spec.js @@ -240,7 +240,7 @@ describe('Git abuse rate limit settings form component', () => { expect(findAllowedUsersFormGroup().attributes('state')).toBe(undefined); - expect(findSubmitButton().attributes('disabled')).toBe('true'); + expect(findSubmitButton().attributes('disabled')).toBeDefined(); }); }); }); @@ -303,7 +303,7 @@ describe('Git abuse rate limit settings form component', () => { expect(findAlertedUsersFormGroup().attributes('state')).toBe(undefined); - expect(findSubmitButton().attributes('disabled')).toBe('true'); + expect(findSubmitButton().attributes('disabled')).toBeDefined(); }); it('should be invalid with 0 users', async () => { @@ -318,7 +318,7 @@ describe('Git abuse rate limit settings form component', () => { expect(findAlertedUsersFormGroup().attributes('state')).toBe(undefined); - expect(findSubmitButton().attributes('disabled')).toBe('true'); + expect(findSubmitButton().attributes('disabled')).toBeDefined(); }); }); }); diff --git a/ee/spec/frontend/ai/components/user_feedback_spec.js b/ee/spec/frontend/ai/components/user_feedback_spec.js index 63a67ba29a9352203635ef34572759ca72a6e1ce..3f81f3975bc4734084ec70038615b724df758e6b 100644 --- a/ee/spec/frontend/ai/components/user_feedback_spec.js +++ b/ee/spec/frontend/ai/components/user_feedback_spec.js @@ -67,7 +67,7 @@ describe('UserFeedback', () => { findButtons().at(selectedButtonIndex).vm.$emit('click'); await nextTick(); expect(findButtons()).toHaveLength(1); - expect(firstButton().attributes('disabled')).toBe('true'); + expect(firstButton().attributes('disabled')).toBeDefined(); expect(firstButton().text()).toBe(FEEDBACK_OPTIONS[selectedButtonIndex].title); }); }); diff --git a/ee/spec/frontend/analytics/cycle_analytics/components/create_value_stream_form/custom_stage_event_field_spec.js b/ee/spec/frontend/analytics/cycle_analytics/components/create_value_stream_form/custom_stage_event_field_spec.js index 28c4a37ce8afaf7a73302475c7d847e4a9796c9d..444beaffefac10f71d4547452b97bc524e91de0a 100644 --- a/ee/spec/frontend/analytics/cycle_analytics/components/create_value_stream_form/custom_stage_event_field_spec.js +++ b/ee/spec/frontend/analytics/cycle_analytics/components/create_value_stream_form/custom_stage_event_field_spec.js @@ -80,7 +80,7 @@ describe('CustomStageEventField', () => { wrapper = createComponent({ disabled: true }); - expect(findEventDropdown().attributes('disabled')).toBe('true'); + expect(findEventDropdown().attributes('disabled')).toBeDefined(); }); }); diff --git a/ee/spec/frontend/analytics/cycle_analytics/components/create_value_stream_form/default_stage_fields_spec.js b/ee/spec/frontend/analytics/cycle_analytics/components/create_value_stream_form/default_stage_fields_spec.js index 25781e9c48321ce94a59b533b3b67005ac6b28b3..eca7fdeeb5a965d8b08b2cb47d3c7552ecdc3056 100644 --- a/ee/spec/frontend/analytics/cycle_analytics/components/create_value_stream_form/default_stage_fields_spec.js +++ b/ee/spec/frontend/analytics/cycle_analytics/components/create_value_stream_form/default_stage_fields_spec.js @@ -54,7 +54,7 @@ describe('DefaultStageFields', () => { }); it('disables input for the stage field name', () => { - expect(findStageFieldNameInput().attributes('disabled')).toBe('disabled'); + expect(findStageFieldNameInput().attributes('disabled')).toBeDefined(); }); it('renders the field start event', () => { diff --git a/ee/spec/frontend/analytics/repository_analytics/components/download_test_coverage_spec.js b/ee/spec/frontend/analytics/repository_analytics/components/download_test_coverage_spec.js index 16f851be59c8cce716d62d40342ba1ef7deedce5..aeff4fea54d496d2932a32fe3c05168c4b92f381 100644 --- a/ee/spec/frontend/analytics/repository_analytics/components/download_test_coverage_spec.js +++ b/ee/spec/frontend/analytics/repository_analytics/components/download_test_coverage_spec.js @@ -104,7 +104,7 @@ describe('Download test coverage component', () => { describe('with no projects selected', () => { it('renders a disabled primary action button', () => { - expect(findCodeCoverageDownloadButton().attributes('disabled')).toBe('true'); + expect(findCodeCoverageDownloadButton().attributes('disabled')).toBeDefined(); }); }); diff --git a/ee/spec/frontend/approvals/components/approval_settings_radio_spec.js b/ee/spec/frontend/approvals/components/approval_settings_radio_spec.js index 81a43df739b82c5bcbea0ab1976683e1e91c4a99..fe948873c55775b1ab4ec0dc640b22cbaab94407 100644 --- a/ee/spec/frontend/approvals/components/approval_settings_radio_spec.js +++ b/ee/spec/frontend/approvals/components/approval_settings_radio_spec.js @@ -61,7 +61,7 @@ describe('ApprovalSettingsRadio', () => { }); it('disables the input', () => { - expect(findRadio().attributes('disabled')).toBe('disabled'); + expect(findRadio().attributes('disabled')).toBeDefined(); }); it('renders locked_icon', () => { diff --git a/ee/spec/frontend/approvals/components/approval_settings_spec.js b/ee/spec/frontend/approvals/components/approval_settings_spec.js index 0e2aaedbe57b99c99d99f64d3d22589f931dfbd5..9a51ea86d793489c4669557f2791921ee45d804e 100644 --- a/ee/spec/frontend/approvals/components/approval_settings_spec.js +++ b/ee/spec/frontend/approvals/components/approval_settings_spec.js @@ -146,7 +146,7 @@ describe('ApprovalSettings', () => { createWrapper(); await waitForPromises(); - expect(findSaveButton().attributes('disabled')).toBe('true'); + expect(findSaveButton().attributes('disabled')).toBeDefined(); }); it('renders the button as enabled when a setting was changed', async () => { diff --git a/ee/spec/frontend/approvals/components/license_compliance/index_spec.js b/ee/spec/frontend/approvals/components/license_compliance/index_spec.js index 42676dff31a74326377972db1e3a67f3c7a52ff7..94b915e3a47311c2ff8c59f57c9fc2a2e92cb2c8 100644 --- a/ee/spec/frontend/approvals/components/license_compliance/index_spec.js +++ b/ee/spec/frontend/approvals/components/license_compliance/index_spec.js @@ -77,7 +77,7 @@ describe('EE Approvals LicenseCompliance', () => { }); it('disables the open-modal button', () => { - expect(findOpenModalButton().attributes('disabled')).toBe('disabled'); + expect(findOpenModalButton().attributes('disabled')).toBeDefined(); }); it('renders a loading indicator', () => { diff --git a/ee/spec/frontend/audit_events/components/stream/stream_destination_editor_spec.js b/ee/spec/frontend/audit_events/components/stream/stream_destination_editor_spec.js index c3410b4ff5deb6a84463bc70310b3653f856bce0..29579bfaca2d3d82bfa9f58587f395032e0fc71b 100644 --- a/ee/spec/frontend/audit_events/components/stream/stream_destination_editor_spec.js +++ b/ee/spec/frontend/audit_events/components/stream/stream_destination_editor_spec.js @@ -157,7 +157,7 @@ describe('StreamDestinationEditor', () => { expect(findHeaderValueInput(0).attributes('placeholder')).toBe( ADD_STREAM_EDITOR_I18N.VALUE_INPUT_PLACEHOLDER, ); - expect(findHeaderCheckbox(0).find('input').attributes('disabled')).toBe('disabled'); + expect(findHeaderCheckbox(0).find('input').attributes('disabled')).toBeDefined(); expect(findHeaderDeleteBtn(0).exists()).toBe(true); }); }); @@ -441,7 +441,7 @@ describe('StreamDestinationEditor', () => { it('disables the destination URL field', () => { expect(findDestinationUrl().element.value).toBe(mockExternalDestinations[0].destinationUrl); - expect(findDestinationUrl().attributes('disabled')).toBe('disabled'); + expect(findDestinationUrl().attributes('disabled')).toBeDefined(); }); it('changes the save button text', () => { diff --git a/ee/spec/frontend/epic/components/epic_form_spec.js b/ee/spec/frontend/epic/components/epic_form_spec.js index 6e83bbea3648d91cb48d16d12b722bce151c8e92..d1712de5d41bfeff16b847568b0b8eceecd6360e 100644 --- a/ee/spec/frontend/epic/components/epic_form_spec.js +++ b/ee/spec/frontend/epic/components/epic_form_spec.js @@ -79,7 +79,7 @@ describe('ee/epic/components/epic_form.vue', () => { }); it('disables submit button if no title is provided', () => { - expect(findSaveButton().attributes('disabled')).toBe('true'); + expect(findSaveButton().attributes('disabled')).toBeDefined(); }); it.each` diff --git a/ee/spec/frontend/escalation_policies/escalation_rule_spec.js b/ee/spec/frontend/escalation_policies/escalation_rule_spec.js index bf26af7471f14988b785405d59357884520c3711..30bf724bc03938c3531689498be56ef42d15b1a3 100644 --- a/ee/spec/frontend/escalation_policies/escalation_rule_spec.js +++ b/ee/spec/frontend/escalation_policies/escalation_rule_spec.js @@ -97,7 +97,7 @@ describe('EscalationRule', () => { it('should disable the dropdown and show the info icon when no schedules provided', () => { createComponent({ props: { schedules: [], schedulesLoading: false } }); - expect(findSchedulesDropdown().attributes('disabled')).toBe('true'); + expect(findSchedulesDropdown().attributes('disabled')).toBeDefined(); expect(findNoSchedulesInfoIcon().exists()).toBe(true); }); diff --git a/ee/spec/frontend/geo_settings/components/geo_settings_form_spec.js b/ee/spec/frontend/geo_settings/components/geo_settings_form_spec.js index 1be9fece2df45025770c093d67ef447299670bd3..1a413e3932f314174856d42d9296d561302d0efc 100644 --- a/ee/spec/frontend/geo_settings/components/geo_settings_form_spec.js +++ b/ee/spec/frontend/geo_settings/components/geo_settings_form_spec.js @@ -57,7 +57,7 @@ describe('GeoSettingsForm', () => { }); it('disables button', () => { - expect(findGeoSettingsSaveButton().attributes('disabled')).toBe('disabled'); + expect(findGeoSettingsSaveButton().attributes('disabled')).toBeDefined(); }); }); diff --git a/ee/spec/frontend/geo_site_form/components/geo_site_form_spec.js b/ee/spec/frontend/geo_site_form/components/geo_site_form_spec.js index 4d98bd941fe2bf512f3e129acde916b5def6096d..06b56b2fafa925525c87a17cef3e4e87982fefe9 100644 --- a/ee/spec/frontend/geo_site_form/components/geo_site_form_spec.js +++ b/ee/spec/frontend/geo_site_form/components/geo_site_form_spec.js @@ -81,7 +81,7 @@ describe('GeoSiteForm', () => { }); it('disables button', () => { - expect(findGeoSiteSaveButton().attributes('disabled')).toBe('true'); + expect(findGeoSiteSaveButton().attributes('disabled')).toBeDefined(); }); }); diff --git a/ee/spec/frontend/integrations/edit/components/jira_issue_creation_vulnerabilities_spec.js b/ee/spec/frontend/integrations/edit/components/jira_issue_creation_vulnerabilities_spec.js index 65c2540fd5373269755153daaf598be601c5b1f5..c4ab845ed4826acfc45e383897f783ac568cf489 100644 --- a/ee/spec/frontend/integrations/edit/components/jira_issue_creation_vulnerabilities_spec.js +++ b/ee/spec/frontend/integrations/edit/components/jira_issue_creation_vulnerabilities_spec.js @@ -104,7 +104,7 @@ describe('JiraIssueCreationVulnerabilities', () => { }); it('disables the checkbox', () => { - expect(findEnableJiraVulnerabilities().attributes('disabled')).toBe('true'); + expect(findEnableJiraVulnerabilities().attributes('disabled')).toBeDefined(); }); }); }); diff --git a/ee/spec/frontend/iterations/components/iteration_cadence_form_spec.js b/ee/spec/frontend/iterations/components/iteration_cadence_form_spec.js index b1314349a6f719a7600813b855c8fa638dd9cc1e..91f0919a196eacfba53e2999b8d9aa5f98003e8b 100644 --- a/ee/spec/frontend/iterations/components/iteration_cadence_form_spec.js +++ b/ee/spec/frontend/iterations/components/iteration_cadence_form_spec.js @@ -282,9 +282,9 @@ describe('Iteration cadence form', () => { }); it('disables the fields concerning automatic scheduling', () => { - expect(findUpcomingIterations().attributes('disabled')).toBe('disabled'); - expect(findDuration().attributes('disabled')).toBe('disabled'); - expect(findStartDate().attributes('disabled')).toBe('disabled'); + expect(findUpcomingIterations().attributes('disabled')).toBeDefined(); + expect(findDuration().attributes('disabled')).toBeDefined(); + expect(findStartDate().attributes('disabled')).toBeDefined(); }); it('resets the fields concerning automatic scheduling on disabling automatic scheduling', async () => { diff --git a/ee/spec/frontend/members/components/table/role_dropdown_spec.js b/ee/spec/frontend/members/components/table/role_dropdown_spec.js index 34f77c9384a4a76b9a1fd9e6c00b3b51fc6ff69c..eed8f433d830b7d83311ee43f3da17de49aa5f45 100644 --- a/ee/spec/frontend/members/components/table/role_dropdown_spec.js +++ b/ee/spec/frontend/members/components/table/role_dropdown_spec.js @@ -53,7 +53,7 @@ describe('RoleDropdown', () => { member: { ...member, isOverridden: false }, }); - expect(findDropdown().attributes('disabled')).toBe('true'); + expect(findDropdown().attributes('disabled')).toBeDefined(); }); }); }); diff --git a/ee/spec/frontend/registrations/groups_projects/new/components/group_project_fields_spec.js b/ee/spec/frontend/registrations/groups_projects/new/components/group_project_fields_spec.js index 15605ffcce01fad356677b91a44112549e075a4d..2cb846fb93efeb2596768679d950e8778e13bd72 100644 --- a/ee/spec/frontend/registrations/groups_projects/new/components/group_project_fields_spec.js +++ b/ee/spec/frontend/registrations/groups_projects/new/components/group_project_fields_spec.js @@ -85,7 +85,7 @@ describe('GroupProjectFields', () => { const groupInput = findInputByTestId('persisted-group-name'); expect(groupInput.exists()).toBe(true); - expect(groupInput.attributes('disabled')).toBe('true'); + expect(groupInput.attributes('disabled')).toBeDefined(); expect(findInputByTestId('group-name').exists()).toBe(false); expect(findInputByTestId('project-name').exists()).toBe(true); diff --git a/ee/spec/frontend/security_configuration/corpus_management/components/corpus_upload_form_spec.js b/ee/spec/frontend/security_configuration/corpus_management/components/corpus_upload_form_spec.js index 402ada6fe3962e56213426345036b89cd0b9e00c..2ce5644db3d32ad7febeb8abbaf95daf534c0cdb 100644 --- a/ee/spec/frontend/security_configuration/corpus_management/components/corpus_upload_form_spec.js +++ b/ee/spec/frontend/security_configuration/corpus_management/components/corpus_upload_form_spec.js @@ -164,7 +164,7 @@ describe('Corpus upload modal', () => { it('shows the choose file button as disabled', () => { expect(findUploadAttachment().exists()).toBe(true); - expect(findUploadAttachment().attributes('disabled')).toBe('disabled'); + expect(findUploadAttachment().attributes('disabled')).toBeDefined(); }); it('does not show the upload corpus button', () => { @@ -362,7 +362,7 @@ describe('Corpus upload modal', () => { it('shows the upload corpus button as disabled', () => { expect(findUploadCorpus().exists()).toBe(true); - expect(findUploadCorpus().attributes('disabled')).toBe('disabled'); + expect(findUploadCorpus().attributes('disabled')).toBeDefined(); }); it('does not show the upload progress', () => { diff --git a/ee/spec/frontend/security_configuration/dast_profiles/components/dast_profiles_list_spec.js b/ee/spec/frontend/security_configuration/dast_profiles/components/dast_profiles_list_spec.js index 01466e5cb62438d05c8bec4ac24e570a1fb405f1..437ba2fb70f90b42a7be85596d354f9b29247474 100644 --- a/ee/spec/frontend/security_configuration/dast_profiles/components/dast_profiles_list_spec.js +++ b/ee/spec/frontend/security_configuration/dast_profiles/components/dast_profiles_list_spec.js @@ -259,7 +259,7 @@ describe('EE - DastProfilesList', () => { createFullComponent({ propsData: { profiles: policySiteProfiles } }); const disabledRow = getAllTableRows()[0]; const deleteButton = getDeleteButtonWithin(disabledRow); - expect(deleteButton.attributes('disabled')).toBe('disabled'); + expect(deleteButton.attributes('disabled')).toBeDefined(); expect(deleteButton.attributes('aria-disabled')).toBe('true'); }); diff --git a/ee/spec/frontend/security_configuration/dast_profiles/dast_scanner_profiles_form/components/dast_scanner_profiles_form_spec.js b/ee/spec/frontend/security_configuration/dast_profiles/dast_scanner_profiles_form/components/dast_scanner_profiles_form_spec.js index ca348110f5430c85ed9c7d1dce80f53992febb81..c75ad07b6a7dfeaae32958668710eef69e0b18b4 100644 --- a/ee/spec/frontend/security_configuration/dast_profiles/dast_scanner_profiles_form/components/dast_scanner_profiles_form_spec.js +++ b/ee/spec/frontend/security_configuration/dast_profiles/dast_scanner_profiles_form/components/dast_scanner_profiles_form_spec.js @@ -183,7 +183,7 @@ describe('DastScannerProfileForm', () => { }); it('should disable all form groups', () => { - expect(findParentFormGroup().attributes('disabled')).toBe('true'); + expect(findParentFormGroup().attributes('disabled')).toBeDefined(); }); }); @@ -197,7 +197,7 @@ describe('DastScannerProfileForm', () => { }); it('should disable the profile name field', () => { - expect(findProfileNameInput().attributes('disabled')).toBe('true'); + expect(findProfileNameInput().attributes('disabled')).toBeDefined(); }); }); }); diff --git a/ee/spec/frontend/security_configuration/dast_profiles/dast_site_profiles/components/dast_site_auth_section_spec.js b/ee/spec/frontend/security_configuration/dast_profiles/dast_site_profiles/components/dast_site_auth_section_spec.js index 1839505a5cf10fe667c946edeac32e9e252e849c..9ef77e80af25e42017b5eeb83b56816249011cb8 100644 --- a/ee/spec/frontend/security_configuration/dast_profiles/dast_site_profiles/components/dast_site_auth_section_spec.js +++ b/ee/spec/frontend/security_configuration/dast_profiles/dast_site_profiles/components/dast_site_auth_section_spec.js @@ -149,7 +149,7 @@ describe('DastSiteAuthSection', () => { describe('when profile does comes from a policy', () => { it('should disable all form groups', () => { createComponent({ mountFn: shallowMount, disabled: true, fields: { enabled: true } }); - expect(findParentFormGroup().attributes('disabled')).toBe('true'); + expect(findParentFormGroup().attributes('disabled')).toBeDefined(); }); }); }); diff --git a/ee/spec/frontend/security_configuration/dast_profiles/dast_site_profiles/components/dast_site_profile_form_spec.js b/ee/spec/frontend/security_configuration/dast_profiles/dast_site_profiles/components/dast_site_profile_form_spec.js index 899be5b64822224212c3bd407aeec2ec26039f09..a4d3b55b01b59fcc33b4f41524d3c57e0503786e 100644 --- a/ee/spec/frontend/security_configuration/dast_profiles/dast_site_profiles/components/dast_site_profile_form_spec.js +++ b/ee/spec/frontend/security_configuration/dast_profiles/dast_site_profiles/components/dast_site_profile_form_spec.js @@ -253,7 +253,7 @@ describe('DastSiteProfileForm', () => { describe('scan method option', () => { it('should render all scan method options', () => { expect(findScanMethodInput().exists()).toBe(true); - expect(getScanMethodOption(0).attributes('disabled')).toBe('disabled'); + expect(getScanMethodOption(0).attributes('disabled')).toBeDefined(); Object.values(SCAN_METHODS).forEach((method, index) => { expect(getScanMethodOption(index + 1).text()).toBe(method.text); }); @@ -363,7 +363,7 @@ describe('DastSiteProfileForm', () => { }); it('should disable all form groups', () => { - expect(findParentFormGroup().attributes('disabled')).toBe('true'); + expect(findParentFormGroup().attributes('disabled')).toBeDefined(); }); }); @@ -377,7 +377,7 @@ describe('DastSiteProfileForm', () => { }); it('should disable the profile name field', () => { - expect(findProfileNameInput().attributes('disabled')).toBe('true'); + expect(findProfileNameInput().attributes('disabled')).toBeDefined(); }); }); }); diff --git a/ee/spec/frontend/security_dashboard/components/instance/project_manager_spec.js b/ee/spec/frontend/security_dashboard/components/instance/project_manager_spec.js index aaed36738e55761431cfc02bfe7c349e8228066b..9753136e87cdda9d7188449609e5eb8be755bf94 100644 --- a/ee/spec/frontend/security_dashboard/components/instance/project_manager_spec.js +++ b/ee/spec/frontend/security_dashboard/components/instance/project_manager_spec.js @@ -133,7 +133,7 @@ describe('Project Manager component', () => { describe('adding projects', () => { it('disables the add project button if no projects are selected', () => { createWrapper({}); - expect(findAddProjectsButton().attributes('disabled')).toBe('true'); + expect(findAddProjectsButton().attributes('disabled')).toBeDefined(); }); it('enables the add project button if projects are selected', () => { diff --git a/ee/spec/frontend/security_dashboard/components/shared/filters/filter_item_spec.js b/ee/spec/frontend/security_dashboard/components/shared/filters/filter_item_spec.js index 3fbd18a02a1cf72be7cf88e18ef9b3f9a1744d2a..d51dcdea41dd1333c8a2dba12e15104569a71084 100644 --- a/ee/spec/frontend/security_dashboard/components/shared/filters/filter_item_spec.js +++ b/ee/spec/frontend/security_dashboard/components/shared/filters/filter_item_spec.js @@ -45,7 +45,7 @@ describe('Filter Item component', () => { }); it('disables the dropdown item', () => { - expect(dropdownItem().attributes('disabled')).toBe('true'); + expect(dropdownItem().attributes('disabled')).toBeDefined(); }); it('displays tooltip', () => { diff --git a/ee/spec/frontend/security_orchestration/components/policy_editor/policy_editor_layout_spec.js b/ee/spec/frontend/security_orchestration/components/policy_editor/policy_editor_layout_spec.js index 842d8f95f9910621d52a05ca6888af4bb943a922..e37d4dede2d736b9144ba9cd4c0c02d632ec1ad7 100644 --- a/ee/spec/frontend/security_orchestration/components/policy_editor/policy_editor_layout_spec.js +++ b/ee/spec/frontend/security_orchestration/components/policy_editor/policy_editor_layout_spec.js @@ -204,7 +204,7 @@ describe('PolicyEditorLayout component', () => { ${'description text area'} | ${findDescriptionTextArea} ${'enabled radio group'} | ${findEnabledRadioGroup} `('disables the $component', ({ findFn }) => { - expect(findFn().attributes('disabled')).toBe('true'); + expect(findFn().attributes('disabled')).toBeDefined(); }); }); @@ -221,7 +221,7 @@ describe('PolicyEditorLayout component', () => { factory({ propsData: { disableUpdate: true } }); await nextTick(); expect(findSavePolicyButton().exists()).toBe(true); - expect(findSavePolicyButton().attributes('disabled')).toBe('true'); + expect(findSavePolicyButton().attributes('disabled')).toBeDefined(); }); it('enables the save button tooltip when "disableTooltip" is false', async () => { diff --git a/ee/spec/frontend/subscriptions/new/components/checkout/confirm_order_spec.js b/ee/spec/frontend/subscriptions/new/components/checkout/confirm_order_spec.js index 8d75d590fca71d2c7f5f30811c6a7b9657955bbc..5fb8120f96b2229d4b07cedcc66dc3b0b1f47d03 100644 --- a/ee/spec/frontend/subscriptions/new/components/checkout/confirm_order_spec.js +++ b/ee/spec/frontend/subscriptions/new/components/checkout/confirm_order_spec.js @@ -77,7 +77,7 @@ describe('Confirm Order', () => { it('button should be disabled', async () => { await nextTick(); - expect(findConfirmButton().attributes('disabled')).toBe('true'); + expect(findConfirmButton().attributes('disabled')).toBeDefined(); }); }); @@ -100,7 +100,7 @@ describe('Confirm Order', () => { store.commit(types.UPDATE_INVOICE_PREVIEW, mockInvoicePreviewBronze); await nextTick(); - expect(findConfirmButton().attributes('disabled')).toBe('true'); + expect(findConfirmButton().attributes('disabled')).toBeDefined(); }); it('should be disabled when not confirming and has invalid price details', async () => { @@ -108,7 +108,7 @@ describe('Confirm Order', () => { store.commit(types.UPDATE_INVOICE_PREVIEW, null); await nextTick(); - expect(findConfirmButton().attributes('disabled')).toBe('true'); + expect(findConfirmButton().attributes('disabled')).toBeDefined(); }); }); }); diff --git a/ee/spec/frontend/subscriptions/new/components/promo_code_input_spec.js b/ee/spec/frontend/subscriptions/new/components/promo_code_input_spec.js index af1e14fd33f0374e32a58af169ff94de4b5af0e6..35e7091896e95f894556760014077cadf1e933d7 100644 --- a/ee/spec/frontend/subscriptions/new/components/promo_code_input_spec.js +++ b/ee/spec/frontend/subscriptions/new/components/promo_code_input_spec.js @@ -25,8 +25,8 @@ describe('PromoCodeInput', () => { const enterPromoCode = () => findPromoCodeInput().vm.$emit('input', samplePromoCode); const assertDisabledState = () => { - expect(findPromoCodeInput().attributes('disabled')).toBe('disabled'); - expect(findApplyButton().attributes('disabled')).toBe('disabled'); + expect(findPromoCodeInput().attributes('disabled')).toBeDefined(); + expect(findApplyButton().attributes('disabled')).toBeDefined(); }; beforeEach(() => { @@ -148,7 +148,7 @@ describe('PromoCodeInput', () => { }); it('disables the apply CTA when there is no promo code', () => { - expect(findApplyButton().attributes('disabled')).toBe('disabled'); + expect(findApplyButton().attributes('disabled')).toBeDefined(); }); it('enables the apply CTA when there is a promo code', async () => { diff --git a/ee/spec/frontend/users/identity_verification/components/verify_phone_verification_code_spec.js b/ee/spec/frontend/users/identity_verification/components/verify_phone_verification_code_spec.js index 0cd6ba0965e70e4744c55293faf2ecac21d190aa..207c99cecad70f4a7fb443b4f1649f3a99e9e4b5 100644 --- a/ee/spec/frontend/users/identity_verification/components/verify_phone_verification_code_spec.js +++ b/ee/spec/frontend/users/identity_verification/components/verify_phone_verification_code_spec.js @@ -135,7 +135,7 @@ describe('Verify phone verification code input component', () => { expect(findVerificationCodeInput().attributes('value')).toBe(''); expect(findVerificationCodeInput().attributes('state')).toBe(undefined); - expect(findVerifyCodeButton().attributes('disabled')).toBe('true'); + expect(findVerifyCodeButton().attributes('disabled')).toBeDefined(); }); }); diff --git a/ee/spec/frontend/vue_merge_request_widget/extensions/status_checks/index_spec.js b/ee/spec/frontend/vue_merge_request_widget/extensions/status_checks/index_spec.js index 1cdc629b8dd5b1293dbfa42684dfeec4f0a5b83d..64a9010eafc0d1852915b0ddf936d35732410a63 100644 --- a/ee/spec/frontend/vue_merge_request_widget/extensions/status_checks/index_spec.js +++ b/ee/spec/frontend/vue_merge_request_widget/extensions/status_checks/index_spec.js @@ -266,7 +266,7 @@ describe('Status checks extension', () => { const actionButton = getAndClickRetryActionButton(); await nextTick(); - expect(actionButton.attributes('disabled')).toBe('disabled'); + expect(actionButton.attributes('disabled')).toBeDefined(); expect(actionButton.find('[aria-label="Loading"]').exists()).toBe(true); }); diff --git a/ee/spec/frontend/vue_shared/license_compliance/license_management_spec.js b/ee/spec/frontend/vue_shared/license_compliance/license_management_spec.js index 6747aa224959e533f03dcefff74e1e33dd26ed3d..96c11df2a0f0a084b36237549172202a6eb605fa 100644 --- a/ee/spec/frontend/vue_shared/license_compliance/license_management_spec.js +++ b/ee/spec/frontend/vue_shared/license_compliance/license_management_spec.js @@ -150,12 +150,12 @@ describe('License Management', () => { await nextTick(); expect(wrapper.findComponent(AddLicenseForm).exists()).toBe(true); - expect(wrapper.findComponent(GlButton).attributes('disabled')).toBe('true'); + expect(wrapper.findComponent(GlButton).attributes('disabled')).toBeDefined(); }); it('should not render the form if the form is closed and have active button', () => { expect(wrapper.findComponent(AddLicenseForm).exists()).toBe(false); - expect(wrapper.findComponent(GlButton).attributes('disabled')).not.toBe('true'); + expect(wrapper.findComponent(GlButton).attributes('disabled')).toBeUndefined(); }); it('should render delete confirmation modal', () => { diff --git a/ee/spec/frontend/vue_shared/purchase_flow/components/step_spec.js b/ee/spec/frontend/vue_shared/purchase_flow/components/step_spec.js index 085cab3dd3440b3b5d856de76b1f4a44090e2987..48c57b89ce4c461a786eeb8d15d1dadc323a2059 100644 --- a/ee/spec/frontend/vue_shared/purchase_flow/components/step_spec.js +++ b/ee/spec/frontend/vue_shared/purchase_flow/components/step_spec.js @@ -183,7 +183,7 @@ describe('Step', () => { const mockApollo = createMockApolloProvider(STEPS, 1); wrapper = createComponent({ propsData: { isValid: false }, apolloProvider: mockApollo }); - expect(wrapper.findComponent(GlButton).attributes('disabled')).toBe('true'); + expect(wrapper.findComponent(GlButton).attributes('disabled')).toBeDefined(); }); it('is enabled when this step is valid', () => { diff --git a/ee/spec/frontend/vulnerabilities/history_comment_editor_spec.js b/ee/spec/frontend/vulnerabilities/history_comment_editor_spec.js index 52493fd2300ebacfa606c5e095a82d3b75a68ee0..2424a29906851935a2310917c2ca07e6d512712e 100644 --- a/ee/spec/frontend/vulnerabilities/history_comment_editor_spec.js +++ b/ee/spec/frontend/vulnerabilities/history_comment_editor_spec.js @@ -83,7 +83,7 @@ describe('History Comment Editor', () => { it('disables all elements when the comment is being saved', () => { createWrapper({ isSaving: true }); - expect(textarea().attributes('disabled')).toBe('true'); + expect(textarea().attributes('disabled')).toBeDefined(); expect(saveButton().props('loading')).toBe(true); expect(cancelButton().props('disabled')).toBe(true); }); diff --git a/spec/frontend/admin/abuse_reports/components/abuse_report_actions_spec.js b/spec/frontend/admin/abuse_reports/components/abuse_report_actions_spec.js index 2d0f00ea585572d62c00f8f7bd3707a19877ec2c..00b8eb2dcff5708650fe2941fd4f0b5640038f23 100644 --- a/spec/frontend/admin/abuse_reports/components/abuse_report_actions_spec.js +++ b/spec/frontend/admin/abuse_reports/components/abuse_report_actions_spec.js @@ -62,7 +62,7 @@ describe('AbuseReportActions', () => { const button = findBlockUserButton(); expect(button.text()).toBe(ACTIONS_I18N.alreadyBlocked); - expect(button.attributes('disabled')).toBe('disabled'); + expect(button.attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/admin/users/components/modals/delete_user_modal_spec.js b/spec/frontend/admin/users/components/modals/delete_user_modal_spec.js index efb951f4ad26058a96a2a704956ac57f724b0553..b2a0c201893d6356411369d37d9f2b29e5417e44 100644 --- a/spec/frontend/admin/users/components/modals/delete_user_modal_spec.js +++ b/spec/frontend/admin/users/components/modals/delete_user_modal_spec.js @@ -84,8 +84,8 @@ describe('Delete user modal', () => { }); it('has disabled buttons', () => { - expect(findPrimaryButton().attributes('disabled')).toBe('true'); - expect(findSecondaryButton().attributes('disabled')).toBe('true'); + expect(findPrimaryButton().attributes('disabled')).toBeDefined(); + expect(findSecondaryButton().attributes('disabled')).toBeDefined(); }); }); @@ -102,8 +102,8 @@ describe('Delete user modal', () => { }); it('has disabled buttons', () => { - expect(findPrimaryButton().attributes('disabled')).toBe('true'); - expect(findSecondaryButton().attributes('disabled')).toBe('true'); + expect(findPrimaryButton().attributes('disabled')).toBeDefined(); + expect(findSecondaryButton().attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/alerts_settings/components/alerts_settings_form_spec.js b/spec/frontend/alerts_settings/components/alerts_settings_form_spec.js index b8575d8ab26d2eb470c17dd2903a1ebd5544746d..5eb5ae2f7836312caaf9740871349007854baa0e 100644 --- a/spec/frontend/alerts_settings/components/alerts_settings_form_spec.js +++ b/spec/frontend/alerts_settings/components/alerts_settings_form_spec.js @@ -99,7 +99,7 @@ describe('AlertsSettingsForm', () => { it('disables the dropdown and shows help text when multi integrations are not supported', () => { createComponent({ props: { canAddIntegration: false } }); - expect(findSelect().attributes('disabled')).toBe('disabled'); + expect(findSelect().attributes('disabled')).toBeDefined(); expect(findMultiSupportText().exists()).toBe(true); }); @@ -433,13 +433,13 @@ describe('AlertsSettingsForm', () => { it('should not be able to submit when no integration type is selected', async () => { await selectOptionAtIndex(0); - expect(findSubmitButton().attributes('disabled')).toBe('disabled'); + expect(findSubmitButton().attributes('disabled')).toBeDefined(); }); it('should not be able to submit when HTTP integration form is invalid', async () => { await selectOptionAtIndex(1); await findFormFields().at(0).vm.$emit('input', ''); - expect(findSubmitButton().attributes('disabled')).toBe('disabled'); + expect(findSubmitButton().attributes('disabled')).toBeDefined(); }); it('should be able to submit when HTTP integration form is valid', async () => { @@ -452,7 +452,7 @@ describe('AlertsSettingsForm', () => { await selectOptionAtIndex(2); await findFormFields().at(0).vm.$emit('input', ''); - expect(findSubmitButton().attributes('disabled')).toBe('disabled'); + expect(findSubmitButton().attributes('disabled')).toBeDefined(); }); it('should be able to submit when Prometheus integration form is valid', async () => { @@ -482,7 +482,7 @@ describe('AlertsSettingsForm', () => { }); await nextTick(); - expect(findSubmitButton().attributes('disabled')).toBe('disabled'); + expect(findSubmitButton().attributes('disabled')).toBeDefined(); }); it('should disable submit button after click on validation failure', async () => { @@ -490,7 +490,7 @@ describe('AlertsSettingsForm', () => { findSubmitButton().trigger('click'); await nextTick(); - expect(findSubmitButton().attributes('disabled')).toBe('disabled'); + expect(findSubmitButton().attributes('disabled')).toBeDefined(); }); it('should scroll to invalid field on validation failure', async () => { diff --git a/spec/frontend/blob/components/blob_header_default_actions_spec.js b/spec/frontend/blob/components/blob_header_default_actions_spec.js index 6e001846bb648498465f39b5c05def76dd090c2e..4c8c256121fedc77e7e77ece0a695fed2ff9ca31 100644 --- a/spec/frontend/blob/components/blob_header_default_actions_spec.js +++ b/spec/frontend/blob/components/blob_header_default_actions_spec.js @@ -67,7 +67,7 @@ describe('Blob Header Default Actions', () => { }); buttons = wrapper.findAllComponents(GlButton); - expect(buttons.at(0).attributes('disabled')).toBe('true'); + expect(buttons.at(0).attributes('disabled')).toBeDefined(); }); it('does not render the copy button if a rendering error is set', () => { diff --git a/spec/frontend/boards/components/board_configuration_options_spec.js b/spec/frontend/boards/components/board_configuration_options_spec.js index d2948daf121bd280ecc26f374f159aee3ceb6f0c..199a08c5d83004ac4ca5254739b4635d5ee3c013 100644 --- a/spec/frontend/boards/components/board_configuration_options_spec.js +++ b/spec/frontend/boards/components/board_configuration_options_spec.js @@ -62,8 +62,8 @@ describe('BoardConfigurationOptions', () => { it('renders checkboxes disabled when user does not have edit rights', () => { createComponent({ readonly: true }); - expect(closedListCheckbox().attributes('disabled')).toBe('true'); - expect(backlogListCheckbox().attributes('disabled')).toBe('true'); + expect(closedListCheckbox().attributes('disabled')).toBeDefined(); + expect(backlogListCheckbox().attributes('disabled')).toBeDefined(); }); it('renders checkboxes enabled when user has edit rights', () => { diff --git a/spec/frontend/ci/artifacts/components/artifact_row_spec.js b/spec/frontend/ci/artifacts/components/artifact_row_spec.js index ee5d62c2d487b4aadbc5268d1e9ebfe03e52b33a..96ddedc3a9d598d91925f0d9edec46ee72934589 100644 --- a/spec/frontend/ci/artifacts/components/artifact_row_spec.js +++ b/spec/frontend/ci/artifacts/components/artifact_row_spec.js @@ -106,7 +106,7 @@ describe('ArtifactRow component', () => { props: { isSelected: false, isSelectedArtifactsLimitReached: true }, }); - expect(findCheckbox().attributes('disabled')).toBe('true'); + expect(findCheckbox().attributes('disabled')).toBeDefined(); expect(findCheckbox().attributes('title')).toBe(I18N_BULK_DELETE_MAX_SELECTED); }); }); diff --git a/spec/frontend/ci/artifacts/components/job_artifacts_table_spec.js b/spec/frontend/ci/artifacts/components/job_artifacts_table_spec.js index fe58f302a1dd9f6da469a54c558a40cd78b4fdc8..514644a92f248ad7db6b187fbbc3a99ad8c33dda 100644 --- a/spec/frontend/ci/artifacts/components/job_artifacts_table_spec.js +++ b/spec/frontend/ci/artifacts/components/job_artifacts_table_spec.js @@ -324,7 +324,7 @@ describe('JobArtifactsTable component', () => { await waitForPromises(); - expect(findDownloadButton().attributes('disabled')).toBe('disabled'); + expect(findDownloadButton().attributes('disabled')).toBeDefined(); }); }); @@ -350,7 +350,7 @@ describe('JobArtifactsTable component', () => { await waitForPromises(); - expect(findBrowseButton().attributes('disabled')).toBe('disabled'); + expect(findBrowseButton().attributes('disabled')).toBeDefined(); }); }); @@ -463,7 +463,7 @@ describe('JobArtifactsTable component', () => { await waitForPromises(); - expect(findDeleteButton().attributes('disabled')).toBe('disabled'); + expect(findDeleteButton().attributes('disabled')).toBeDefined(); }); it('is hidden when user does not have delete permission', async () => { diff --git a/spec/frontend/ci/artifacts/components/job_checkbox_spec.js b/spec/frontend/ci/artifacts/components/job_checkbox_spec.js index 56f1d8cc47b8e6a533482f1218c7dc41ee4ed3a0..8b47571239c464b5658871aacc784a4d5f0e74c8 100644 --- a/spec/frontend/ci/artifacts/components/job_checkbox_spec.js +++ b/spec/frontend/ci/artifacts/components/job_checkbox_spec.js @@ -33,7 +33,7 @@ describe('JobCheckbox component', () => { it('is disabled when the job has no artifacts', () => { createComponent({ hasArtifacts: false }); - expect(findCheckbox().attributes('disabled')).toBe('true'); + expect(findCheckbox().attributes('disabled')).toBeDefined(); }); describe('when some artifacts from this job are selected', () => { @@ -124,7 +124,7 @@ describe('JobCheckbox component', () => { it('is disabled when the selected artifacts limit has been reached', () => { // job checkbox is disabled to block further selection - expect(findCheckbox().attributes('disabled')).toBe('true'); + expect(findCheckbox().attributes('disabled')).toBeDefined(); expect(findCheckbox().attributes('title')).toBe(I18N_BULK_DELETE_MAX_SELECTED); }); }); diff --git a/spec/frontend/ci/ci_variable_list/components/ci_variable_modal_spec.js b/spec/frontend/ci/ci_variable_list/components/ci_variable_modal_spec.js index e8bfb370fb479751a82393fa951a3d35da093e95..b6ffde9b33f18e10689cef0429ef3feb732f8308 100644 --- a/spec/frontend/ci/ci_variable_list/components/ci_variable_modal_spec.js +++ b/spec/frontend/ci/ci_variable_list/components/ci_variable_modal_spec.js @@ -95,7 +95,7 @@ describe('Ci variable modal', () => { }); it('shows the submit button as disabled', () => { - expect(findAddorUpdateButton().attributes('disabled')).toBe('true'); + expect(findAddorUpdateButton().attributes('disabled')).toBeDefined(); }); }); @@ -507,7 +507,7 @@ describe('Ci variable modal', () => { }); it('disables the submit button', () => { - expect(findAddorUpdateButton().attributes('disabled')).toBe('disabled'); + expect(findAddorUpdateButton().attributes('disabled')).toBeDefined(); }); it('shows the correct error text', () => { diff --git a/spec/frontend/ci/pipeline_editor/components/commit/commit_form_spec.js b/spec/frontend/ci/pipeline_editor/components/commit/commit_form_spec.js index 03f346181e402b55327df9fa207a3e0d01c4353a..4b0ddacef934d23eefd181e233c941482158132f 100644 --- a/spec/frontend/ci/pipeline_editor/components/commit/commit_form_spec.js +++ b/spec/frontend/ci/pipeline_editor/components/commit/commit_form_spec.js @@ -93,7 +93,7 @@ describe('Pipeline Editor | Commit Form', () => { createComponent({ props: { hasUnsavedChanges, isNewCiConfigFile } }); if (isDisabled) { - expect(findSubmitBtn().attributes('disabled')).toBe('true'); + expect(findSubmitBtn().attributes('disabled')).toBeDefined(); } else { expect(findSubmitBtn().attributes('disabled')).toBeUndefined(); } @@ -132,7 +132,7 @@ describe('Pipeline Editor | Commit Form', () => { it('when the commit message is empty, submit button is disabled', async () => { await findCommitTextarea().setValue(''); - expect(findSubmitBtn().attributes('disabled')).toBe('disabled'); + expect(findSubmitBtn().attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/ci/runner/admin_runners/admin_runners_app_spec.js b/spec/frontend/ci/runner/admin_runners/admin_runners_app_spec.js index 2cd1bc0b2f814af7652e759395dfa5c7042ab913..6fc6c0b608586fb39a02a0ec7fba2532640ad4cc 100644 --- a/spec/frontend/ci/runner/admin_runners/admin_runners_app_spec.js +++ b/spec/frontend/ci/runner/admin_runners/admin_runners_app_spec.js @@ -388,7 +388,7 @@ describe('AdminRunnersApp', () => { it('when runners have not loaded, shows a loading state', () => { createComponent(); expect(findRunnerList().props('loading')).toBe(true); - expect(findRunnerPagination().attributes('disabled')).toBe('true'); + expect(findRunnerPagination().attributes('disabled')).toBeDefined(); }); describe('Bulk delete', () => { diff --git a/spec/frontend/ci/runner/components/runner_jobs_spec.js b/spec/frontend/ci/runner/components/runner_jobs_spec.js index 365b0f1f5baaf22f578a37dc0dc0fa5f07fcc8b6..367b9ce395d868c5e4dae6e6920ebba92e34b02f 100644 --- a/spec/frontend/ci/runner/components/runner_jobs_spec.js +++ b/spec/frontend/ci/runner/components/runner_jobs_spec.js @@ -99,7 +99,7 @@ describe('RunnerJobs', () => { expect(findGlSkeletonLoading().exists()).toBe(true); expect(findRunnerJobsTable().exists()).toBe(false); - expect(findRunnerPagination().attributes('disabled')).toBe('true'); + expect(findRunnerPagination().attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/ci/runner/components/runner_projects_spec.js b/spec/frontend/ci/runner/components/runner_projects_spec.js index afdc54d8ebc8901549cb24d303cd314253086991..736a1f7d3ce8e58773e83d525a1fa35ef41e38aa 100644 --- a/spec/frontend/ci/runner/components/runner_projects_spec.js +++ b/spec/frontend/ci/runner/components/runner_projects_spec.js @@ -194,7 +194,7 @@ describe('RunnerProjects', () => { expect(wrapper.findByText(I18N_NO_PROJECTS_FOUND).exists()).toBe(false); expect(findRunnerAssignedItems().length).toBe(0); - expect(findRunnerPagination().attributes('disabled')).toBe('true'); + expect(findRunnerPagination().attributes('disabled')).toBeDefined(); expect(findGlSearchBoxByType().props('isLoading')).toBe(true); }); }); diff --git a/spec/frontend/ci/runner/group_runners/group_runners_app_spec.js b/spec/frontend/ci/runner/group_runners/group_runners_app_spec.js index 6824242cba9c3613dd93ac753e5e1e214ebee715..5b2ddeafe0418983103e5dde38f45477c012d288 100644 --- a/spec/frontend/ci/runner/group_runners/group_runners_app_spec.js +++ b/spec/frontend/ci/runner/group_runners/group_runners_app_spec.js @@ -391,7 +391,7 @@ describe('GroupRunnersApp', () => { it('when runners have not loaded, shows a loading state', () => { createComponent(); expect(findRunnerList().props('loading')).toBe(true); - expect(findRunnerPagination().attributes('disabled')).toBe('true'); + expect(findRunnerPagination().attributes('disabled')).toBeDefined(); }); it('runners can be deleted in bulk', () => { diff --git a/spec/frontend/clusters/agents/components/create_token_button_spec.js b/spec/frontend/clusters/agents/components/create_token_button_spec.js index 5a8906813cfc08ac120f4366500ebf086ab1d860..2bbde33d6f4873240bb0d75f3680c9afb59d066f 100644 --- a/spec/frontend/clusters/agents/components/create_token_button_spec.js +++ b/spec/frontend/clusters/agents/components/create_token_button_spec.js @@ -55,7 +55,7 @@ describe('CreateTokenButton', () => { }); it('disabled the button', () => { - expect(findButton().attributes('disabled')).toBe('true'); + expect(findButton().attributes('disabled')).toBeDefined(); }); it('shows a disabled tooltip', () => { diff --git a/spec/frontend/clusters/agents/components/create_token_modal_spec.js b/spec/frontend/clusters/agents/components/create_token_modal_spec.js index fe3e1844118cbc0769812bf9556092504590f7fe..f0fded7b7b2ec80d093a10195823c1f182695eef 100644 --- a/spec/frontend/clusters/agents/components/create_token_modal_spec.js +++ b/spec/frontend/clusters/agents/components/create_token_modal_spec.js @@ -61,7 +61,7 @@ describe('CreateTokenModal', () => { const expectDisabledAttribute = (element, disabled) => { if (disabled) { - expect(element.attributes('disabled')).toBe('true'); + expect(element.attributes('disabled')).toBeDefined(); } else { expect(element.attributes('disabled')).toBeUndefined(); } diff --git a/spec/frontend/clusters/agents/components/revoke_token_button_spec.js b/spec/frontend/clusters/agents/components/revoke_token_button_spec.js index 76c32abb5e4c75b8c12e85f22f51d8baee5fd024..970782a8e582f8f78b58938e3a47650b9a8f2dd6 100644 --- a/spec/frontend/clusters/agents/components/revoke_token_button_spec.js +++ b/spec/frontend/clusters/agents/components/revoke_token_button_spec.js @@ -119,7 +119,7 @@ describe('RevokeTokenButton', () => { }); it('disabled the button', () => { - expect(findRevokeBtn().attributes('disabled')).toBe('true'); + expect(findRevokeBtn().attributes('disabled')).toBeDefined(); }); it('shows a disabled tooltip', () => { @@ -217,7 +217,7 @@ describe('RevokeTokenButton', () => { it('reenables the button', async () => { expect(findPrimaryActionAttributes('loading')).toBe(true); - expect(findRevokeBtn().attributes('disabled')).toBe('true'); + expect(findRevokeBtn().attributes('disabled')).toBeDefined(); await findModal().vm.$emit('hide'); diff --git a/spec/frontend/clusters_list/components/delete_agent_button_spec.js b/spec/frontend/clusters_list/components/delete_agent_button_spec.js index 53cf67bca0f0a3fb9f1697239397eafd0fe38684..2c9a6b1167198da29cd86bcf5fe44c358121a3dd 100644 --- a/spec/frontend/clusters_list/components/delete_agent_button_spec.js +++ b/spec/frontend/clusters_list/components/delete_agent_button_spec.js @@ -140,7 +140,7 @@ describe('DeleteAgentButton', () => { }); it('disables the button', () => { - expect(findDeleteBtn().attributes('disabled')).toBe('true'); + expect(findDeleteBtn().attributes('disabled')).toBeDefined(); }); it('shows a disabled tooltip', () => { @@ -230,7 +230,7 @@ describe('DeleteAgentButton', () => { it('reenables the button', async () => { expect(findPrimaryActionAttributes('loading')).toBe(true); - expect(findDeleteBtn().attributes('disabled')).toBe('true'); + expect(findDeleteBtn().attributes('disabled')).toBeDefined(); await findModal().vm.$emit('hide'); diff --git a/spec/frontend/clusters_list/components/install_agent_modal_spec.js b/spec/frontend/clusters_list/components/install_agent_modal_spec.js index f9009696c7b8b704574e1721c78558f352020da3..e1306e2738f3c4692a1164ee9671c7116e6a0372 100644 --- a/spec/frontend/clusters_list/components/install_agent_modal_spec.js +++ b/spec/frontend/clusters_list/components/install_agent_modal_spec.js @@ -74,7 +74,7 @@ describe('InstallAgentModal', () => { const expectDisabledAttribute = (element, disabled) => { if (disabled) { - expect(element.attributes('disabled')).toBe('true'); + expect(element.attributes('disabled')).toBeDefined(); } else { expect(element.attributes('disabled')).toBeUndefined(); } diff --git a/spec/frontend/deploy_freeze/components/deploy_freeze_modal_spec.js b/spec/frontend/deploy_freeze/components/deploy_freeze_modal_spec.js index 77118ae140a0be244f614f0d2267bc8469aa27b4..1cd16e39417d17e8267219e456a126af0810522a 100644 --- a/spec/frontend/deploy_freeze/components/deploy_freeze_modal_spec.js +++ b/spec/frontend/deploy_freeze/components/deploy_freeze_modal_spec.js @@ -48,7 +48,7 @@ describe('Deploy freeze modal', () => { describe('Basic interactions', () => { it('button is disabled when freeze period is invalid', () => { - expect(submitDeployFreezeButton().attributes('disabled')).toBe('true'); + expect(submitDeployFreezeButton().attributes('disabled')).toBeDefined(); }); }); @@ -88,7 +88,7 @@ describe('Deploy freeze modal', () => { }); it('disables the add deploy freeze button', () => { - expect(submitDeployFreezeButton().attributes('disabled')).toBe('true'); + expect(submitDeployFreezeButton().attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/design_management/components/delete_button_spec.js b/spec/frontend/design_management/components/delete_button_spec.js index 81e3b21a91090abf1b53cf448cdf7619684c9d0e..cacda9a475e41c9e4468b99e9d48ef70e6d1b251 100644 --- a/spec/frontend/design_management/components/delete_button_spec.js +++ b/spec/frontend/design_management/components/delete_button_spec.js @@ -30,7 +30,7 @@ describe('Batch delete button component', () => { it('renders disabled button when design is deleting', () => { createComponent({ isDeleting: true }); - expect(findButton().attributes('disabled')).toBe('true'); + expect(findButton().attributes('disabled')).toBeDefined(); }); it('emits `delete-selected-designs` event on modal ok click', async () => { diff --git a/spec/frontend/environments/environment_actions_spec.js b/spec/frontend/environments/environment_actions_spec.js index dcfefbb2072b71ca3e1be77c8a448026dd162f43..b7e192839da0888b3c9ddb16779d5084aa8beb43 100644 --- a/spec/frontend/environments/environment_actions_spec.js +++ b/spec/frontend/environments/environment_actions_spec.js @@ -84,7 +84,7 @@ describe('EnvironmentActions Component', () => { it("should render a disabled action when it's not playable", () => { const dropdownItems = findDropdownItems(); const lastDropdownItem = dropdownItems.at(dropdownItems.length - 1); - expect(lastDropdownItem.find('button').attributes('disabled')).toBe('disabled'); + expect(lastDropdownItem.find('button').attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/error_tracking_settings/components/app_spec.js b/spec/frontend/error_tracking_settings/components/app_spec.js index 7a714cc1ebcf41449ab0fa165e26e67eb1aae81a..dfe9652073eb975974f8241a6a448cf92f4d71f4 100644 --- a/spec/frontend/error_tracking_settings/components/app_spec.js +++ b/spec/frontend/error_tracking_settings/components/app_spec.js @@ -92,7 +92,7 @@ describe('error tracking settings app', () => { store.state.settingsLoading = true; await nextTick(); - expect(wrapper.find('.js-error-tracking-button').attributes('disabled')).toBe('true'); + expect(wrapper.find('.js-error-tracking-button').attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/feature_flags/components/configure_feature_flags_modal_spec.js b/spec/frontend/feature_flags/components/configure_feature_flags_modal_spec.js index a12c25c689725cbeb8478eac29826df32f3ce1a7..b75e2f653e9c57a4d7fbc1aa1fff1998db2924ce 100644 --- a/spec/frontend/feature_flags/components/configure_feature_flags_modal_spec.js +++ b/spec/frontend/feature_flags/components/configure_feature_flags_modal_spec.js @@ -152,7 +152,7 @@ describe('Configure Feature Flags Modal', () => { beforeEach(factory.bind(null, { isRotating: true })); it('should disable the project name input', () => { - expect(findProjectNameInput().attributes('disabled')).toBe('true'); + expect(findProjectNameInput().attributes('disabled')).toBeDefined(); }); }); }); diff --git a/spec/frontend/ide/components/commit_sidebar/new_merge_request_option_spec.js b/spec/frontend/ide/components/commit_sidebar/new_merge_request_option_spec.js index adc9a0f1421a72fcfbbd917718bcadb465f71cc9..ce26519abc98de98367f2b98a7774a5f9abf838c 100644 --- a/spec/frontend/ide/components/commit_sidebar/new_merge_request_option_spec.js +++ b/spec/frontend/ide/components/commit_sidebar/new_merge_request_option_spec.js @@ -66,7 +66,7 @@ describe('NewMergeRequestOption component', () => { }); it('disables the new MR checkbox', () => { - expect(findCheckbox().attributes('disabled')).toBe('true'); + expect(findCheckbox().attributes('disabled')).toBeDefined(); }); it('adds `is-disabled` class to the fieldset', () => { diff --git a/spec/frontend/ide/components/jobs/detail/scroll_button_spec.js b/spec/frontend/ide/components/jobs/detail/scroll_button_spec.js index eec1bd6b12384f664e88baa4b43427c4f50f5637..450c6cb357cb42e0c15270e5ea6a4179e955d4b1 100644 --- a/spec/frontend/ide/components/jobs/detail/scroll_button_spec.js +++ b/spec/frontend/ide/components/jobs/detail/scroll_button_spec.js @@ -41,6 +41,6 @@ describe('IDE job log scroll button', () => { it('disables button when disabled is true', () => { createComponent({ disabled: true }); - expect(wrapper.find('button').attributes('disabled')).toBe('disabled'); + expect(wrapper.find('button').attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/ide/components/jobs/detail_spec.js b/spec/frontend/ide/components/jobs/detail_spec.js index 60e03a7b8821e4edf55d14fc3a63358dfbc6e5b1..334501bbca7efb97615111c3d35bbfebf3ad57ff 100644 --- a/spec/frontend/ide/components/jobs/detail_spec.js +++ b/spec/frontend/ide/components/jobs/detail_spec.js @@ -119,8 +119,8 @@ describe('IDE jobs detail view', () => { await findBuildJobLog().trigger('scroll'); - expect(findScrollToBottomButton().attributes('disabled')).toBe('disabled'); - expect(findScrollToTopButton().attributes('disabled')).not.toBe('disabled'); + expect(findScrollToBottomButton().attributes('disabled')).toBeDefined(); + expect(findScrollToTopButton().attributes('disabled')).toBeUndefined(); }); it('keeps scroll at top when already at top', async () => { @@ -128,8 +128,8 @@ describe('IDE jobs detail view', () => { await findBuildJobLog().trigger('scroll'); - expect(findScrollToBottomButton().attributes('disabled')).not.toBe('disabled'); - expect(findScrollToTopButton().attributes('disabled')).toBe('disabled'); + expect(findScrollToBottomButton().attributes('disabled')).toBeUndefined(); + expect(findScrollToTopButton().attributes('disabled')).toBeDefined(); }); it('resets scroll when not at top or bottom', async () => { @@ -137,8 +137,8 @@ describe('IDE jobs detail view', () => { await findBuildJobLog().trigger('scroll'); - expect(findScrollToBottomButton().attributes('disabled')).not.toBe('disabled'); - expect(findScrollToTopButton().attributes('disabled')).not.toBe('disabled'); + expect(findScrollToBottomButton().attributes('disabled')).toBeUndefined(); + expect(findScrollToTopButton().attributes('disabled')).toBeUndefined(); }); }); }); diff --git a/spec/frontend/import_entities/import_groups/components/import_target_cell_spec.js b/spec/frontend/import_entities/import_groups/components/import_target_cell_spec.js index a957e85723faaa176c52f3c9d924bd1df809d07a..46884a42707e4d56906501f426865cad191e5ebd 100644 --- a/spec/frontend/import_entities/import_groups/components/import_target_cell_spec.js +++ b/spec/frontend/import_entities/import_groups/components/import_target_cell_spec.js @@ -141,7 +141,7 @@ describe('import target cell', () => { }); it('renders namespace dropdown as disabled', () => { - expect(findNamespaceDropdown().attributes('disabled')).toBe('true'); + expect(findNamespaceDropdown().attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/integrations/edit/components/active_checkbox_spec.js b/spec/frontend/integrations/edit/components/active_checkbox_spec.js index 8afff842a856dab3e8cb2564b6446fdf0628b66c..3a78140d0b1713bde703caadae60f14bfcfe3474 100644 --- a/spec/frontend/integrations/edit/components/active_checkbox_spec.js +++ b/spec/frontend/integrations/edit/components/active_checkbox_spec.js @@ -26,7 +26,7 @@ describe('ActiveCheckbox', () => { createComponent({}, { isInheriting: true }); expect(findGlFormCheckbox().exists()).toBe(true); - expect(findInputInCheckbox().attributes('disabled')).toBe('disabled'); + expect(findInputInCheckbox().attributes('disabled')).toBeDefined(); }); }); @@ -35,7 +35,7 @@ describe('ActiveCheckbox', () => { createComponent({ activateDisabled: true }); expect(findGlFormCheckbox().exists()).toBe(true); - expect(findInputInCheckbox().attributes('disabled')).toBe('disabled'); + expect(findInputInCheckbox().attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/integrations/edit/components/jira_trigger_fields_spec.js b/spec/frontend/integrations/edit/components/jira_trigger_fields_spec.js index f876a497f98c93d0709be262c200876ad2b28cc7..a038b63d28cb32f7a9252ddff7518069ee606d20 100644 --- a/spec/frontend/integrations/edit/components/jira_trigger_fields_spec.js +++ b/spec/frontend/integrations/edit/components/jira_trigger_fields_spec.js @@ -187,7 +187,7 @@ describe('JiraTriggerFields', () => { ); wrapper.findAll('[type=text], [type=checkbox], [type=radio]').wrappers.forEach((input) => { - expect(input.attributes('disabled')).toBe('disabled'); + expect(input.attributes('disabled')).toBeDefined(); }); }); }); diff --git a/spec/frontend/integrations/edit/components/trigger_field_spec.js b/spec/frontend/integrations/edit/components/trigger_field_spec.js index 3b736b33a2f1c6c7afbe11bafd6cfdd3b4f4feec..b3d6784959f7e1f8042bf0c2ecc39753a0eb1300 100644 --- a/spec/frontend/integrations/edit/components/trigger_field_spec.js +++ b/spec/frontend/integrations/edit/components/trigger_field_spec.js @@ -37,7 +37,7 @@ describe('TriggerField', () => { it('when isInheriting is true, renders disabled GlFormCheckbox', () => { createComponent({ isInheriting: true }); - expect(findGlFormCheckbox().attributes('disabled')).toBe('true'); + expect(findGlFormCheckbox().attributes('disabled')).toBeDefined(); }); it('renders correct title', () => { diff --git a/spec/frontend/issuable/components/related_issuable_item_spec.js b/spec/frontend/issuable/components/related_issuable_item_spec.js index ca217a9fa7fd2f677b9e6bda5551ee37ebc006bc..7322894164b9ae95803256879072eb9d1d1aff2f 100644 --- a/spec/frontend/issuable/components/related_issuable_item_spec.js +++ b/spec/frontend/issuable/components/related_issuable_item_spec.js @@ -195,7 +195,7 @@ describe('RelatedIssuableItem', () => { }); it('renders disabled button when removeDisabled', () => { - expect(findRemoveButton().attributes('disabled')).toBe('true'); + expect(findRemoveButton().attributes('disabled')).toBeDefined(); }); it('triggers onRemoveRequest when clicked', () => { diff --git a/spec/frontend/issues/show/components/edit_actions_spec.js b/spec/frontend/issues/show/components/edit_actions_spec.js index ca561149806b8f1654bfa26b354af86a931d562e..0ebeb1b7b5614904796e0147a43b10be6794e8da 100644 --- a/spec/frontend/issues/show/components/edit_actions_spec.js +++ b/spec/frontend/issues/show/components/edit_actions_spec.js @@ -66,7 +66,7 @@ describe('Edit Actions component', () => { it('disables save button when title is blank', () => { createComponent({ props: { formState: { title: '', issue_type: '' } } }); - expect(findSaveButton().attributes('disabled')).toBe('true'); + expect(findSaveButton().attributes('disabled')).toBeDefined(); }); describe('updateIssuable', () => { diff --git a/spec/frontend/jobs/components/job/job_log_controllers_spec.js b/spec/frontend/jobs/components/job/job_log_controllers_spec.js index 9917c63b2d0e94f6337a5cb04a810957a85ea6cc..db060c0d606e996b64adb774b8e303f940610a76 100644 --- a/spec/frontend/jobs/components/job/job_log_controllers_spec.js +++ b/spec/frontend/jobs/components/job/job_log_controllers_spec.js @@ -133,7 +133,7 @@ describe('Job log controllers', () => { }); it('renders disabled scroll top button', () => { - expect(findScrollTop().attributes('disabled')).toBe('disabled'); + expect(findScrollTop().attributes('disabled')).toBeDefined(); }); it('does not emit scrollJobLogTop event on click', async () => { diff --git a/spec/frontend/monitoring/components/dashboard_actions_menu_spec.js b/spec/frontend/monitoring/components/dashboard_actions_menu_spec.js index 2758103fd6e92ee360fc2c8ca59309c43c615ff1..c54acf3cbeedbfca9e9c5be6a07986f9100cd4b0 100644 --- a/spec/frontend/monitoring/components/dashboard_actions_menu_spec.js +++ b/spec/frontend/monitoring/components/dashboard_actions_menu_spec.js @@ -319,7 +319,7 @@ describe('Actions menu', () => { await nextTick(); expect(findStarDashboardItem().exists()).toBe(true); - expect(findStarDashboardItem().attributes('disabled')).toBe('true'); + expect(findStarDashboardItem().attributes('disabled')).toBeDefined(); }); it('on click it dispatches a toggle star action', async () => { @@ -365,7 +365,7 @@ describe('Actions menu', () => { }); it('is rendered by default but it is disabled', () => { - expect(findCreateDashboardItem().attributes('disabled')).toBe('true'); + expect(findCreateDashboardItem().attributes('disabled')).toBeDefined(); }); describe('when project path is set', () => { @@ -410,7 +410,7 @@ describe('Actions menu', () => { }); it('is disabled', () => { - expect(findCreateDashboardItem().attributes('disabled')).toBe('true'); + expect(findCreateDashboardItem().attributes('disabled')).toBeDefined(); }); it('does not render a modal for creating a dashboard', () => { diff --git a/spec/frontend/notes/components/comment_form_spec.js b/spec/frontend/notes/components/comment_form_spec.js index 04143bb5b606f027dd246d90194406921a31178f..fb64551c76b3b262904749b3248526f048768a38 100644 --- a/spec/frontend/notes/components/comment_form_spec.js +++ b/spec/frontend/notes/components/comment_form_spec.js @@ -303,7 +303,7 @@ describe('issue_comment_form component', () => { await findCommentButton().trigger('click'); - expect(findMarkdownEditor().find('textarea').attributes('disabled')).toBe('disabled'); + expect(findMarkdownEditor().find('textarea').attributes('disabled')).toBeDefined(); }); it('should support quick actions', () => { diff --git a/spec/frontend/notes/components/note_form_spec.js b/spec/frontend/notes/components/note_form_spec.js index d6413d33c99d367be5d6f7c492f18d44be87da76..9423af4f05873095f399791ecff8ffe31fac0e50 100644 --- a/spec/frontend/notes/components/note_form_spec.js +++ b/spec/frontend/notes/components/note_form_spec.js @@ -177,7 +177,7 @@ describe('issue_note_form component', () => { await nextTick(); - expect(textarea.attributes('disabled')).toBe('disabled'); + expect(textarea.attributes('disabled')).toBeDefined(); }); }); }); diff --git a/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row_spec.js b/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row_spec.js index bfefe46c09bdf124468245daad6d00f3bc508706..f74dfcb029dd585fb86d31604e5b1ff47259ac29 100644 --- a/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row_spec.js +++ b/spec/frontend/packages_and_registries/container_registry/explorer/components/details_page/tags_list_row_spec.js @@ -153,7 +153,7 @@ describe('tags list row', () => { it('is disabled when the component is disabled', () => { mountComponent({ ...defaultProps, disabled: true }); - expect(findClipboardButton().attributes('disabled')).toBe('true'); + expect(findClipboardButton().attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/image_list_row_spec.js b/spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/image_list_row_spec.js index 7da9c7533a007ca3d2540cab3d78374b2aefcd14..5d8df45415ef910298f79403e669de5dee9a79d3 100644 --- a/spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/image_list_row_spec.js +++ b/spec/frontend/packages_and_registries/container_registry/explorer/components/list_page/image_list_row_spec.js @@ -145,7 +145,7 @@ describe('Image List Row', () => { }); it('the clipboard button is disabled', () => { - expect(findClipboardButton().attributes('disabled')).toBe('true'); + expect(findClipboardButton().attributes('disabled')).toBeDefined(); }); }); }); diff --git a/spec/frontend/packages_and_registries/infrastructure_registry/components/shared/package_list_row_spec.js b/spec/frontend/packages_and_registries/infrastructure_registry/components/shared/package_list_row_spec.js index 37ca420ae77be925df1c1f9bd058ad8e95ce15fc..d00d7180f754ce8cd4ccf89c3ae684ab30f00831 100644 --- a/spec/frontend/packages_and_registries/infrastructure_registry/components/shared/package_list_row_spec.js +++ b/spec/frontend/packages_and_registries/infrastructure_registry/components/shared/package_list_row_spec.js @@ -138,7 +138,7 @@ describe('packages_list_row', () => { }); it('details link is disabled', () => { - expect(findPackageLink().attributes('disabled')).toBe('true'); + expect(findPackageLink().attributes('disabled')).toBeDefined(); }); it('has a warning icon', () => { diff --git a/spec/frontend/packages_and_registries/settings/group/components/exceptions_input_spec.js b/spec/frontend/packages_and_registries/settings/group/components/exceptions_input_spec.js index 461200e69836f45d86aaa31800c3d254315b681d..dd1edbaa3fdb1f94db885ea46c20ac2fa9f93ed0 100644 --- a/spec/frontend/packages_and_registries/settings/group/components/exceptions_input_spec.js +++ b/spec/frontend/packages_and_registries/settings/group/components/exceptions_input_spec.js @@ -98,7 +98,7 @@ describe('Exceptions Input', () => { }); it('disables the form input', () => { - expect(findInput().attributes('disabled')).toBe('true'); + expect(findInput().attributes('disabled')).toBeDefined(); }); }); }); diff --git a/spec/frontend/packages_and_registries/shared/components/package_path_spec.js b/spec/frontend/packages_and_registries/shared/components/package_path_spec.js index 2490e9a1f6a2665a4fa2c3c215c8c57f358cc6d4..3ffbb6f435c1f4079d62368492c2d19a39bdfbee 100644 --- a/spec/frontend/packages_and_registries/shared/components/package_path_spec.js +++ b/spec/frontend/packages_and_registries/shared/components/package_path_spec.js @@ -86,12 +86,12 @@ describe('PackagePath', () => { }); it('root link is disabled', () => { - expect(findItem(ROOT_LINK).attributes('disabled')).toBe('true'); + expect(findItem(ROOT_LINK).attributes('disabled')).toBeDefined(); }); if (shouldExist.includes(LEAF_LINK)) { it('the last link is disabled', () => { - expect(findItem(LEAF_LINK).attributes('disabled')).toBe('true'); + expect(findItem(LEAF_LINK).attributes('disabled')).toBeDefined(); }); } }); diff --git a/spec/frontend/packages_and_registries/shared/components/registry_list_spec.js b/spec/frontend/packages_and_registries/shared/components/registry_list_spec.js index 85b4ca95d5dcced21ebdb9dc5b2434643eb9206b..66fca2ce12e01f7c2fe7e6d7727656976292bb71 100644 --- a/spec/frontend/packages_and_registries/shared/components/registry_list_spec.js +++ b/spec/frontend/packages_and_registries/shared/components/registry_list_spec.js @@ -58,7 +58,7 @@ describe('Registry List', () => { it('sets disabled prop to true when items length is 0', () => { mountComponent({ propsData: { ...defaultPropsData, items: [] } }); - expect(findSelectAll().attributes('disabled')).toBe('true'); + expect(findSelectAll().attributes('disabled')).toBeDefined(); }); it('when few are selected, sets indeterminate prop to true', async () => { diff --git a/spec/frontend/pages/projects/shared/permissions/components/settings_panel_spec.js b/spec/frontend/pages/projects/shared/permissions/components/settings_panel_spec.js index d8a848f0a2eef464975481643982bd09c74fb9a9..a7a1e649cd00ed04c3efa3b8cdcc69cb8ef3f191 100644 --- a/spec/frontend/pages/projects/shared/permissions/components/settings_panel_spec.js +++ b/spec/frontend/pages/projects/shared/permissions/components/settings_panel_spec.js @@ -158,7 +158,7 @@ describe('Settings Panel', () => { it('should disable the visibility level dropdown', () => { wrapper = mountComponent({ canChangeVisibilityLevel: false }); - expect(findProjectVisibilityLevelInput().attributes('disabled')).toBe('disabled'); + expect(findProjectVisibilityLevelInput().attributes('disabled')).toBeDefined(); }); it.each` diff --git a/spec/frontend/pipeline_wizard/components/step_nav_spec.js b/spec/frontend/pipeline_wizard/components/step_nav_spec.js index e80eb01ea7a32c2a4fb9f8d4ee8fccb048849355..8a94f58523af70533b1760e63622e3afc967d653 100644 --- a/spec/frontend/pipeline_wizard/components/step_nav_spec.js +++ b/spec/frontend/pipeline_wizard/components/step_nav_spec.js @@ -56,13 +56,13 @@ describe('Pipeline Wizard - Step Navigation Component', () => { it('enables the next button if nextButtonEnabled ist set to true', () => { createComponent({ nextButtonEnabled: true }); - expect(nextButton.attributes('disabled')).not.toBe('disabled'); + expect(nextButton.attributes('disabled')).toBeUndefined(); }); it('disables the next button if nextButtonEnabled ist set to false', () => { createComponent({ nextButtonEnabled: false }); - expect(nextButton.attributes('disabled')).toBe('disabled'); + expect(nextButton.attributes('disabled')).toBeDefined(); }); it('does not emit "next" event when clicking next button while nextButtonEnabled ist set to false', async () => { diff --git a/spec/frontend/pipelines/graph/job_item_spec.js b/spec/frontend/pipelines/graph/job_item_spec.js index 5cc2c76f3dd73a66b0301c4b70f1cf9f4511f4e7..2a5dfd7e0ee8d5e13dcec900eb7c1adfa851b7cd 100644 --- a/spec/frontend/pipelines/graph/job_item_spec.js +++ b/spec/frontend/pipelines/graph/job_item_spec.js @@ -121,7 +121,7 @@ describe('pipeline graph job item', () => { expect(actionComponent.exists()).toBe(true); expect(actionComponent.props('actionIcon')).toBe('retry'); - expect(actionComponent.attributes('disabled')).not.toBe('disabled'); + expect(actionComponent.attributes('disabled')).toBeUndefined(); }); it('should render disabled action icon when user cannot run the action', () => { @@ -135,7 +135,7 @@ describe('pipeline graph job item', () => { expect(actionComponent.exists()).toBe(true); expect(actionComponent.props('actionIcon')).toBe('stop'); - expect(actionComponent.attributes('disabled')).toBe('disabled'); + expect(actionComponent.attributes('disabled')).toBeDefined(); }); it('action icon tooltip text when job has passed but can be ran again', () => { diff --git a/spec/frontend/pipelines/pipelines_manual_actions_spec.js b/spec/frontend/pipelines/pipelines_manual_actions_spec.js index e47e57db887bf0346e00d39b264722a75975fd0e..82cab88c9eb3eb4d40e20b5d08aa6ee228e7ff42 100644 --- a/spec/frontend/pipelines/pipelines_manual_actions_spec.js +++ b/spec/frontend/pipelines/pipelines_manual_actions_spec.js @@ -101,7 +101,7 @@ describe('Pipeline manual actions', () => { }); it("displays a disabled action when it's not playable", () => { - expect(findAllDropdownItems().at(0).attributes('disabled')).toBe('true'); + expect(findAllDropdownItems().at(0).attributes('disabled')).toBeDefined(); }); describe('on action click', () => { diff --git a/spec/frontend/profile/account/components/update_username_spec.js b/spec/frontend/profile/account/components/update_username_spec.js index 3cb9cf3622ac519b965680463037fc30193375be..fa107600d64caf16b828304059e323e669b3d3a6 100644 --- a/spec/frontend/profile/account/components/update_username_spec.js +++ b/spec/frontend/profile/account/components/update_username_spec.js @@ -117,7 +117,7 @@ describe('UpdateUsername component', () => { const { input, openModalBtn, modal } = findElements(); axiosMock.onPut(actionUrl).replyOnce(() => { - expect(input.attributes('disabled')).toBe('disabled'); + expect(input.attributes('disabled')).toBeDefined(); expect(openModalBtn.props('disabled')).toBe(false); expect(openModalBtn.props('loading')).toBe(true); @@ -136,7 +136,7 @@ describe('UpdateUsername component', () => { const { input, openModalBtn } = findElements(); axiosMock.onPut(actionUrl).replyOnce(() => { - expect(input.attributes('disabled')).toBe('disabled'); + expect(input.attributes('disabled')).toBeDefined(); expect(openModalBtn.props('disabled')).toBe(false); expect(openModalBtn.props('loading')).toBe(true); diff --git a/spec/frontend/projects/commits/components/author_select_spec.js b/spec/frontend/projects/commits/components/author_select_spec.js index b06463e73a7f05891e78a2103e84f05676188385..630b8feafbcff4aaf814215f495a529e4f6c5ff9 100644 --- a/spec/frontend/projects/commits/components/author_select_spec.js +++ b/spec/frontend/projects/commits/components/author_select_spec.js @@ -81,7 +81,7 @@ describe('Author Select', () => { }); it('disables dropdown', () => { - expect(findDropdown().attributes('disabled')).toBe('true'); + expect(findDropdown().attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/projects/components/shared/delete_button_spec.js b/spec/frontend/projects/components/shared/delete_button_spec.js index 364a29d0e41499e955a3a9673ff6f3c3b85f92bd..6b4ef341b0ca44a816e040ebfe3556aa69498bfd 100644 --- a/spec/frontend/projects/components/shared/delete_button_spec.js +++ b/spec/frontend/projects/components/shared/delete_button_spec.js @@ -69,7 +69,7 @@ describe('Project remove modal', () => { }); it('the confirm button is disabled', () => { - expect(findConfirmButton().attributes('disabled')).toBe('true'); + expect(findConfirmButton().attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/projects/new/components/deployment_target_select_spec.js b/spec/frontend/projects/new/components/deployment_target_select_spec.js index bec738f7765f3c41a1518433dfb8634c386b52ea..57b804b632a4773de8dc4b330169296b8104c06c 100644 --- a/spec/frontend/projects/new/components/deployment_target_select_spec.js +++ b/spec/frontend/projects/new/components/deployment_target_select_spec.js @@ -56,7 +56,7 @@ describe('Deployment target select', () => { it('renders a select with the disabled default option', () => { expect(findSelect().find('option').text()).toBe('Select the deployment target'); - expect(findSelect().find('option').attributes('disabled')).toBe('disabled'); + expect(findSelect().find('option').attributes('disabled')).toBeDefined(); }); describe.each` diff --git a/spec/frontend/projects/settings/components/transfer_project_form_spec.js b/spec/frontend/projects/settings/components/transfer_project_form_spec.js index a92ac1bed9d1cb58482551c1dbb95a6729b8659f..e12938c3baba1d99bcfc87fa2170ee1fdda4adca 100644 --- a/spec/frontend/projects/settings/components/transfer_project_form_spec.js +++ b/spec/frontend/projects/settings/components/transfer_project_form_spec.js @@ -49,7 +49,7 @@ describe('Transfer project form', () => { it('disables the confirm button by default', () => { createComponent(); - expect(findConfirmDanger().attributes('disabled')).toBe('true'); + expect(findConfirmDanger().attributes('disabled')).toBeDefined(); }); describe('with a selected namespace', () => { diff --git a/spec/frontend/releases/components/app_edit_new_spec.js b/spec/frontend/releases/components/app_edit_new_spec.js index d253c42e03f2f0b45b0393a42c8b4fae4f98bf15..69d8969f0ad7c1cb3a622ef01816dca18b5ee598 100644 --- a/spec/frontend/releases/components/app_edit_new_spec.js +++ b/spec/frontend/releases/components/app_edit_new_spec.js @@ -309,7 +309,7 @@ describe('Release edit/new component', () => { }); it('renders the submit button as disabled', () => { - expect(findSubmitButton().attributes('disabled')).toBe('disabled'); + expect(findSubmitButton().attributes('disabled')).toBeDefined(); }); it('does not allow the form to be submitted', () => { diff --git a/spec/frontend/search/sidebar/components/filters_spec.js b/spec/frontend/search/sidebar/components/filters_spec.js index 51c7bdd9609a27919d347536b68b5c466f4a2083..d189c69546744b71acd17df0d1de5f71c3c61f6f 100644 --- a/spec/frontend/search/sidebar/components/filters_spec.js +++ b/spec/frontend/search/sidebar/components/filters_spec.js @@ -66,7 +66,7 @@ describe('GlobalSearchSidebarFilters', () => { }); it('disables the button', () => { - expect(findApplyButton().attributes('disabled')).toBe('true'); + expect(findApplyButton().attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/search/sidebar/components/language_filter_spec.js b/spec/frontend/search/sidebar/components/language_filter_spec.js index 5821def5b432ae0d0a182598d0f478583ef22f38..9ad9d095acab5fbe3d859f3e71dd3188cee85eb6 100644 --- a/spec/frontend/search/sidebar/components/language_filter_spec.js +++ b/spec/frontend/search/sidebar/components/language_filter_spec.js @@ -132,7 +132,7 @@ describe('GlobalSearchSidebarLanguageFilter', () => { }); it('disables the button', () => { - expect(findApplyButton().attributes('disabled')).toBe('true'); + expect(findApplyButton().attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/security_configuration/components/training_provider_list_spec.js b/spec/frontend/security_configuration/components/training_provider_list_spec.js index d35fc00057a8e4a2f611168071900ae3a9b73d56..2982cef7c748e07585fd0b8e9d55e165e5933c52 100644 --- a/spec/frontend/security_configuration/components/training_provider_list_spec.js +++ b/spec/frontend/security_configuration/components/training_provider_list_spec.js @@ -401,7 +401,7 @@ describe('TrainingProviderList component', () => { it('has disabled state for radio', () => { findPrimaryProviderRadios().wrappers.forEach((radio) => { - expect(radio.attributes('disabled')).toBe('true'); + expect(radio.attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/sidebar/components/lock/edit_form_buttons_spec.js b/spec/frontend/sidebar/components/lock/edit_form_buttons_spec.js index ad9efc371f0215b8183eb03dea90f7ec4f865a17..2c256a67bb005c96d1601f285310de1776d9479d 100644 --- a/spec/frontend/sidebar/components/lock/edit_form_buttons_spec.js +++ b/spec/frontend/sidebar/components/lock/edit_form_buttons_spec.js @@ -69,7 +69,7 @@ describe('EditFormButtons', () => { }); it('disables the toggle button', () => { - expect(findLockToggle().attributes('disabled')).toBe('disabled'); + expect(findLockToggle().attributes('disabled')).toBeDefined(); }); it('sets loading on the toggle button', () => { diff --git a/spec/frontend/sidebar/components/move/issuable_move_dropdown_spec.js b/spec/frontend/sidebar/components/move/issuable_move_dropdown_spec.js index ab3e71bdddbd1fc3aa71468299c26c71c524ebe6..56c915c4cae8ef7f714cc3849e4c3eea6fa2aded 100644 --- a/spec/frontend/sidebar/components/move/issuable_move_dropdown_spec.js +++ b/spec/frontend/sidebar/components/move/issuable_move_dropdown_spec.js @@ -279,7 +279,7 @@ describe('IssuableMoveDropdown', () => { const moveButtonEl = findFooter().findComponent(GlButton); expect(moveButtonEl.text()).toBe('Move'); - expect(moveButtonEl.attributes('disabled')).toBe('true'); + expect(moveButtonEl.attributes('disabled')).toBeDefined(); findDropdownEl().vm.$emit('shown'); await waitForPromises(); diff --git a/spec/frontend/sidebar/components/move/move_issues_button_spec.js b/spec/frontend/sidebar/components/move/move_issues_button_spec.js index 2c7982a4b7feb3e55f65b7a6b2cfcb15b1effe41..83b32d04fcf9adf6c3fd42a2e65028687ba0bced 100644 --- a/spec/frontend/sidebar/components/move/move_issues_button_spec.js +++ b/spec/frontend/sidebar/components/move/move_issues_button_spec.js @@ -166,7 +166,7 @@ describe('MoveIssuesButton', () => { it('renders disabled by default', () => { createComponent(); expect(findDropdown().exists()).toBe(true); - expect(findDropdown().attributes('disabled')).toBe('true'); + expect(findDropdown().attributes('disabled')).toBeDefined(); }); it.each` @@ -185,7 +185,7 @@ describe('MoveIssuesButton', () => { await nextTick(); if (disabled) { - expect(findDropdown().attributes('disabled')).toBe('true'); + expect(findDropdown().attributes('disabled')).toBeDefined(); } else { expect(findDropdown().attributes('disabled')).toBeUndefined(); } diff --git a/spec/frontend/super_sidebar/components/super_sidebar_toggle_spec.js b/spec/frontend/super_sidebar/components/super_sidebar_toggle_spec.js index a12434a9e485b92881729e55a9fdc136f975b71d..8bb20186e16e8707f44c4265420f62cf6a256649 100644 --- a/spec/frontend/super_sidebar/components/super_sidebar_toggle_spec.js +++ b/spec/frontend/super_sidebar/components/super_sidebar_toggle_spec.js @@ -57,7 +57,7 @@ describe('SuperSidebarToggle component', () => { it('is disabled when isPeek is true', () => { createWrapper({ sidebarState: { isPeek: true } }); - expect(findButton().attributes('disabled')).toBe('true'); + expect(findButton().attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/terms/components/app_spec.js b/spec/frontend/terms/components/app_spec.js index c60c6c79f176e05500c374db44759dbdc9f93c8c..cab7fbe18b08853c01020adc5270464827d57ce9 100644 --- a/spec/frontend/terms/components/app_spec.js +++ b/spec/frontend/terms/components/app_spec.js @@ -65,7 +65,6 @@ describe('TermsApp', () => { describe('accept button', () => { it('is disabled until user scrolls to the bottom of the terms', async () => { createComponent(); - expect(findButton(defaultProvide.paths.accept).attributes('disabled')).toBe('disabled'); wrapper.findComponent(GlIntersectionObserver).vm.$emit('appear'); diff --git a/spec/frontend/vue_merge_request_widget/components/artifacts_list_app_spec.js b/spec/frontend/vue_merge_request_widget/components/artifacts_list_app_spec.js index 332f14a17212749d7f4e77274637f0cbd7e74579..9516aacea0af254f5bbf087642b0346062a4d237 100644 --- a/spec/frontend/vue_merge_request_widget/components/artifacts_list_app_spec.js +++ b/spec/frontend/vue_merge_request_widget/components/artifacts_list_app_spec.js @@ -70,8 +70,8 @@ describe('Merge Requests Artifacts list app', () => { it('renders disabled buttons', () => { const buttons = findButtons(); - expect(buttons.at(0).attributes('disabled')).toBe('disabled'); - expect(buttons.at(1).attributes('disabled')).toBe('disabled'); + expect(buttons.at(0).attributes('disabled')).toBeDefined(); + expect(buttons.at(1).attributes('disabled')).toBeDefined(); }); }); diff --git a/spec/frontend/vue_merge_request_widget/components/states/mr_widget_auto_merge_failed_spec.js b/spec/frontend/vue_merge_request_widget/components/states/mr_widget_auto_merge_failed_spec.js index 9b043bda72d5b4038a75b5febbdf16e20b981ce5..e65deb2db3d55f77b67bd95128ff59d6b425aabb 100644 --- a/spec/frontend/vue_merge_request_widget/components/states/mr_widget_auto_merge_failed_spec.js +++ b/spec/frontend/vue_merge_request_widget/components/states/mr_widget_auto_merge_failed_spec.js @@ -44,7 +44,7 @@ describe('MRWidgetAutoMergeFailed', () => { await nextTick(); - expect(findButton().attributes('disabled')).toBe('disabled'); + expect(findButton().attributes('disabled')).toBeDefined(); expect(wrapper.findComponent(GlLoadingIcon).exists()).toBe(true); }); }); diff --git a/spec/frontend/vue_shared/components/confirm_danger/confirm_danger_spec.js b/spec/frontend/vue_shared/components/confirm_danger/confirm_danger_spec.js index 379b5cde4d52bfa98df77ec2b488f08fcf03dcc1..e082fa4085fd6b80c7f334466796a83576420f16 100644 --- a/spec/frontend/vue_shared/components/confirm_danger/confirm_danger_spec.js +++ b/spec/frontend/vue_shared/components/confirm_danger/confirm_danger_spec.js @@ -48,7 +48,7 @@ describe('Confirm Danger Modal', () => { wrapper = createComponent({ disabled: true }); - expect(findBtn().attributes('disabled')).toBe('true'); + expect(findBtn().attributes('disabled')).toBeDefined(); }); it('passes `buttonClass` prop to button', () => { diff --git a/spec/frontend/vue_shared/components/markdown/markdown_editor_spec.js b/spec/frontend/vue_shared/components/markdown/markdown_editor_spec.js index 69dedd6b68ae23d48dde942dab496d757484a19d..3fb7b8dc8674b859a9b751d3799c997c03852c01 100644 --- a/spec/frontend/vue_shared/components/markdown/markdown_editor_spec.js +++ b/spec/frontend/vue_shared/components/markdown/markdown_editor_spec.js @@ -142,7 +142,7 @@ describe('vue_shared/component/markdown/markdown_editor', () => { it('disables markdown field when disabled prop is true', () => { buildWrapper({ propsData: { disabled: true } }); - expect(findMarkdownField().find('textarea').attributes('disabled')).toBe('disabled'); + expect(findMarkdownField().find('textarea').attributes('disabled')).toBeDefined(); }); it('enables markdown field when disabled prop is false', () => { diff --git a/spec/frontend/webhooks/components/form_url_mask_item_spec.js b/spec/frontend/webhooks/components/form_url_mask_item_spec.js index 06c743749a611e663ac12ca67b9328408d78eac2..6bae0ca985423a72dabf934a6bcfe734525b01bd 100644 --- a/spec/frontend/webhooks/components/form_url_mask_item_spec.js +++ b/spec/frontend/webhooks/components/form_url_mask_item_spec.js @@ -57,12 +57,12 @@ describe('FormUrlMaskItem', () => { }); it('renders disabled key and value', () => { - expect(findMaskItemKey().findComponent(GlFormInput).attributes('disabled')).toBe('true'); - expect(findMaskItemValue().findComponent(GlFormInput).attributes('disabled')).toBe('true'); + expect(findMaskItemKey().findComponent(GlFormInput).attributes('disabled')).toBeDefined(); + expect(findMaskItemValue().findComponent(GlFormInput).attributes('disabled')).toBeDefined(); }); it('renders disabled remove button', () => { - expect(findRemoveButton().attributes('disabled')).toBe('true'); + expect(findRemoveButton().attributes('disabled')).toBeDefined(); }); it('displays ************ as input value', () => { diff --git a/spec/frontend/work_items/components/work_item_links/work_item_links_form_spec.js b/spec/frontend/work_items/components/work_item_links/work_item_links_form_spec.js index 5184b24d2021dcef3872aedffba0072cb9cc0637..6100bbea4a1d824a1d40b41b5a63710be99cc5f2 100644 --- a/spec/frontend/work_items/components/work_item_links/work_item_links_form_spec.js +++ b/spec/frontend/work_items/components/work_item_links/work_item_links_form_spec.js @@ -150,7 +150,7 @@ describe('WorkItemLinksForm', () => { const confidentialCheckbox = findConfidentialCheckbox(); const confidentialTooltip = wrapper.findComponent(GlTooltip); - expect(confidentialCheckbox.attributes('disabled')).toBe('true'); + expect(confidentialCheckbox.attributes('disabled')).toBeDefined(); expect(confidentialCheckbox.attributes('checked')).toBe('true'); expect(confidentialTooltip.exists()).toBe(true); expect(confidentialTooltip.text()).toBe(