[ACS-7368] Fix unit tests for aca-content (#3779)

This commit is contained in:
dominikiwanekhyland
2024-04-10 09:05:22 +02:00
committed by MichalKinas
parent 7013ab0f00
commit 968d25ef49
16 changed files with 21 additions and 156 deletions

View File

@@ -317,7 +317,7 @@ describe('ManageRulesSmartComponent', () => {
fixture.detectChanges();
const createButton = await loader.getHarness(
MatSlideToggleHarness.with({ selector: `[data-automation-id="manage-rules-inheritance-toggle-button"]` })
MatSlideToggleHarness.with({ selector: `[data-automation-id="manage-rules-inheritance-toggle-button"] button` })
);
expect(createButton).toBeTruthy();

View File

@@ -27,7 +27,7 @@ import { RuleSimpleConditionUiComponent } from './rule-simple-condition.ui-compo
import { CoreTestingModule } from '@alfresco/adf-core';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { tagMock, mimeTypeMock, simpleConditionUnknownFieldMock, categoriesListMock } from '../../mock/conditions.mock';
import { categoriesListMock, mimeTypeMock, simpleConditionUnknownFieldMock, tagMock } from '../../mock/conditions.mock';
import { MimeType } from './rule-mime-types';
import { CategoryService, TagService } from '@alfresco/adf-content-services';
import { of } from 'rxjs';

View File

@@ -12,14 +12,14 @@
data-automation-id="rule-option-form-field-errorScript"
floatLabel="always"
[ngClass]="{ 'aca-hide-error-script-dropdown': hideErrorScriptDropdown }">
<mat-label>{{ 'ACA_FOLDER_RULES.RULE_DETAILS.OPTIONS.ERROR_SCRIPT' | translate }}</mat-label>
<mat-select
formControlName="errorScript"
placeholder="{{ 'ACA_FOLDER_RULES.RULE_DETAILS.OPTIONS.ERROR_SCRIPT' | translate}}"
data-automation-id="rule-option-select-errorScript">
<mat-option value="">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.OPTIONS.NO_SCRIPT' | translate }}</mat-option>
<mat-option class="aca-rule-options__error-script-option" value="">{{ 'ACA_FOLDER_RULES.RULE_DETAILS.OPTIONS.NO_SCRIPT' | translate }}</mat-option>
<mat-option *ngFor="let option of errorScriptOptions"
class="aca-rule-options__error-script-option"
[value]="option.value">
{{ option.label }}
</mat-option>

View File

@@ -43,7 +43,7 @@ describe('RuleOptionsUiComponent', () => {
fixture.debugElement.query(By.css(`[data-automation-id="${dataAutomationId}"]`));
const toggleMatCheckbox = (dataAutomationId: string) => {
((getByDataAutomationId(dataAutomationId).nativeElement as HTMLElement).children[0] as HTMLElement).click();
(getByDataAutomationId(dataAutomationId).nativeElement as HTMLElement).querySelector('input').click();
};
const testErrorScriptFormFieldVisibility = (isVisible: boolean) => {
@@ -153,7 +153,7 @@ describe('RuleOptionsUiComponent', () => {
expect((await matOptions[2].getText()).trim()).toBe('Script 2');
});
it('should always show a label for the error script dropdown even when MAT_FORM_FIELD_DEFAULT_OPTIONS sets floatLabel to auto', () => {
it('should always show a label for the error script dropdown', () => {
component.writeValue({
isEnabled: true,
isInheritable: false,

View File

@@ -36,7 +36,7 @@ describe('RuleTriggerUiComponent', () => {
fixture.debugElement.query(By.css(`[data-automation-id="${dataAutomationId}"]`));
const toggleMatCheckbox = (dataAutomationId: string) => {
((getByDataAutomationId(dataAutomationId).nativeElement as HTMLElement).children[0] as HTMLElement).click();
(getByDataAutomationId(dataAutomationId).nativeElement as HTMLElement).querySelector('input').click();
};
beforeEach(() => {