[ACS-5540]lint fixes

This commit is contained in:
Yasa-Nataliya
2023-10-09 20:22:06 +05:30
parent 80d68add3d
commit b8b921ccff
@@ -77,16 +77,19 @@ describe('ContentMetadataComponent', () => {
const findTagElements = (): DebugElement[] => fixture.debugElement.queryAll(By.css('.adf-metadata-properties .adf-metadata-properties-tag')); const findTagElements = (): DebugElement[] => fixture.debugElement.queryAll(By.css('.adf-metadata-properties .adf-metadata-properties-tag'));
const findCancelButton = (): HTMLButtonElement => fixture.debugElement.query(By.css('[data-automation-id=reset-metadata]')).nativeElement; const findCancelButton = (): HTMLButtonElement => fixture.debugElement.query(By.css('[data-automation-id=reset-metadata]')).nativeElement;
const findCancelTagsButton = (): HTMLButtonElement => fixture.debugElement.query(By.css('[data-automation-id=reset-tags-metadata]')).nativeElement; const findCancelTagsButton = (): HTMLButtonElement =>
fixture.debugElement.query(By.css('[data-automation-id=reset-tags-metadata]')).nativeElement;
const clickOnCancel = () => { const clickOnCancel = () => {
findCancelButton().click(); findCancelButton().click();
fixture.detectChanges(); fixture.detectChanges();
}; };
const findSaveGeneralInfoButton = (): HTMLButtonElement => fixture.debugElement.query(By.css('[data-automation-id=save-general-info-metadata]')).nativeElement; const findSaveGeneralInfoButton = (): HTMLButtonElement =>
fixture.debugElement.query(By.css('[data-automation-id=save-general-info-metadata]')).nativeElement;
const findSaveTagsButton = (): HTMLButtonElement => fixture.debugElement.query(By.css('[data-automation-id=save-tags-metadata]')).nativeElement; const findSaveTagsButton = (): HTMLButtonElement => fixture.debugElement.query(By.css('[data-automation-id=save-tags-metadata]')).nativeElement;
const findSaveCategoriesButton = (): HTMLButtonElement => fixture.debugElement.query(By.css('[data-automation-id=save-categories-metadata]')).nativeElement; const findSaveCategoriesButton = (): HTMLButtonElement =>
fixture.debugElement.query(By.css('[data-automation-id=save-categories-metadata]')).nativeElement;
const clickOnGeneralInfoSave = () => { const clickOnGeneralInfoSave = () => {
findSaveGeneralInfoButton().click(); findSaveGeneralInfoButton().click();
@@ -435,7 +438,8 @@ describe('ContentMetadataComponent', () => {
describe('toggleEdit', () => { describe('toggleEdit', () => {
let mockEvent: MouseEvent; let mockEvent: MouseEvent;
let mockGroup: CardViewGroup = { let mockGroup: CardViewGroup = {
editable: false, expanded: false, editable: false,
expanded: false,
title: '', title: '',
properties: [] properties: []
}; };
@@ -443,7 +447,7 @@ describe('ContentMetadataComponent', () => {
mockEvent = new MouseEvent('click'); mockEvent = new MouseEvent('click');
component.editableGroup = mockGroup; component.editableGroup = mockGroup;
}); });
it('should toggle General Info editing mode', () => { it('should toggle General Info editing mode', () => {
component.editable = false; component.editable = false;
component.toggleEdit(mockEvent, mockGroup, ButtonType.GeneralInfo); component.toggleEdit(mockEvent, mockGroup, ButtonType.GeneralInfo);
@@ -478,7 +482,7 @@ describe('ContentMetadataComponent', () => {
expect(mockGroup.expanded).toBe(true); expect(mockGroup.expanded).toBe(true);
} }
}); });
it('should show Snackbar when Editing Panel is Active', () => { it('should show Snackbar when Editing Panel is Active', () => {
spyOn(component, 'isEditingPanel').and.returnValue(true); spyOn(component, 'isEditingPanel').and.returnValue(true);
spyOn(component, 'showSnackbar'); spyOn(component, 'showSnackbar');
@@ -509,7 +513,8 @@ describe('ContentMetadataComponent', () => {
it('should toggle group editable', () => { it('should toggle group editable', () => {
const group: CardViewGroup = { const group: CardViewGroup = {
editable: false, expanded: false, editable: false,
expanded: false,
title: '', title: '',
properties: [] properties: []
}; };
@@ -661,7 +666,6 @@ describe('ContentMetadataComponent', () => {
}); });
it('should hide card views group when the grouped properties are empty', async () => { it('should hide card views group when the grouped properties are empty', async () => {
spyOn(contentMetadataService, 'getGroupedProperties').and.stub(); spyOn(contentMetadataService, 'getGroupedProperties').and.stub();
component.ngOnChanges({ node: new SimpleChange(node, expectedNode, false) }); component.ngOnChanges({ node: new SimpleChange(node, expectedNode, false) });
@@ -1384,7 +1388,7 @@ describe('ContentMetadataComponent', () => {
expect(categoriesManagementComponent.disableRemoval).toBeFalse(); expect(categoriesManagementComponent.disableRemoval).toBeFalse();
}); });
it('should not disable removal if forkJoin fails',() => { it('should not disable removal if forkJoin fails', () => {
const property = { key: 'properties.property-key', value: 'original-value' } as CardViewBaseItemModel; const property = { key: 'properties.property-key', value: 'original-value' } as CardViewBaseItemModel;
const expectedNode = { ...node, name: 'some-modified-value' }; const expectedNode = { ...node, name: 'some-modified-value' };
spyOn(nodesApiService, 'updateNode').and.returnValue(of(expectedNode)); spyOn(nodesApiService, 'updateNode').and.returnValue(of(expectedNode));