mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-09-16 18:12:50 +00:00
[ACS-12441] unit tests fixes [link-adf:improvement/AAE-51237-upgrade-angular-to-v21][ci:force]
This commit is contained in:
+10
-5
@@ -67,6 +67,11 @@ describe('BulkActionsDropdownComponent', () => {
|
||||
|
||||
const getLabelText = (selector: string): string => getElement(selector).textContent.trim();
|
||||
|
||||
const getPlaceholderText = async (): Promise<string> => {
|
||||
const selectHarness = await loader.getHarness(MatSelectHarness);
|
||||
return selectHarness.getValueText();
|
||||
};
|
||||
|
||||
const selectOptionFromDropdown = async (selectionIndex: number) => {
|
||||
const selectHarness = await loader.getHarness(MatSelectHarness);
|
||||
await selectHarness.open();
|
||||
@@ -91,6 +96,7 @@ describe('BulkActionsDropdownComponent', () => {
|
||||
|
||||
component.items = [mockItem];
|
||||
fixture.detectChanges();
|
||||
loader = TestbedHarnessEnvironment.loader(fixture);
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
@@ -109,8 +115,8 @@ describe('BulkActionsDropdownComponent', () => {
|
||||
expect(dropdown.getAttribute('aria-disabled')).toBe('true');
|
||||
});
|
||||
|
||||
it('should have correct placeholder', () => {
|
||||
expect(getLabelText('aca-bulk-actions-dropdown')).toEqual('SEARCH.BULK_ACTIONS_DROPDOWN.BULK_NOT_AVAILABLE');
|
||||
it('should have correct placeholder', async () => {
|
||||
await expect(await getPlaceholderText()).toEqual('SEARCH.BULK_ACTIONS_DROPDOWN.BULK_NOT_AVAILABLE');
|
||||
});
|
||||
|
||||
it('should call translationService.get with correct arguments', () => {
|
||||
@@ -132,8 +138,8 @@ describe('BulkActionsDropdownComponent', () => {
|
||||
expect(dropdown.getAttribute('aria-disabled')).toBe('false');
|
||||
});
|
||||
|
||||
it('should have correct placeholder', () => {
|
||||
expect(getLabelText('aca-bulk-actions-dropdown')).toEqual('SEARCH.BULK_ACTIONS_DROPDOWN.TITLE');
|
||||
it('should have correct placeholder', async () => {
|
||||
await expect(await getPlaceholderText()).toEqual('SEARCH.BULK_ACTIONS_DROPDOWN.TITLE');
|
||||
});
|
||||
|
||||
it('should have option with correct tooltip', () => {
|
||||
@@ -163,7 +169,6 @@ describe('BulkActionsDropdownComponent', () => {
|
||||
extensionService = TestBed.inject(AppExtensionService);
|
||||
spyOn(extensionService, 'getBulkActions').and.returnValue(of([mockItem]));
|
||||
fixture.detectChanges();
|
||||
loader = TestbedHarnessEnvironment.loader(fixture);
|
||||
});
|
||||
|
||||
it('should run action on selection', async () => {
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
} @else {
|
||||
<mat-progress-spinner
|
||||
class="aca-page-layout-spinner"
|
||||
class="aca-page-layout-content aca-page-layout-spinner"
|
||||
data-automation-id="'saved-search-list-spinner'"
|
||||
[color]="'primary'"
|
||||
[mode]="'indeterminate'" />
|
||||
|
||||
+8
-8
@@ -138,8 +138,8 @@ describe('NodeInformationComponent', () => {
|
||||
expect(getNumberOfFiles()).toBe('APP.NODE_INFO.CALCULATING');
|
||||
expect(getNodeSize()).toBe('APP.NODE_INFO.CALCULATING');
|
||||
expect(getNodeLocation()).toBe('mock-folder-path');
|
||||
expect(getNodeCreationDate()).toBe('2/1/24, 11:11 AM');
|
||||
expect(getNodeModifyDate()).toBe('3/2/24, 10:22 PM');
|
||||
expect(getNodeCreationDate()).toBe('2/1/24, 11:11 AM');
|
||||
expect(getNodeModifyDate()).toBe('3/2/24, 10:22 PM');
|
||||
});
|
||||
|
||||
it('should make API call on init to start folder size calculation', () => {
|
||||
@@ -243,8 +243,8 @@ describe('NodeInformationComponent', () => {
|
||||
expect(getNodeName()).toBe('mock-file');
|
||||
expect(getNodeSize()).toBe('1000 CORE.FILE_SIZE.BYTES');
|
||||
expect(getNodeLocation()).toBe('mock-file-path');
|
||||
expect(getNodeCreationDate()).toBe('2/1/24, 11:11 AM');
|
||||
expect(getNodeModifyDate()).toBe('3/2/24, 10:22 PM');
|
||||
expect(getNodeCreationDate()).toBe('2/1/24, 11:11 AM');
|
||||
expect(getNodeModifyDate()).toBe('3/2/24, 10:22 PM');
|
||||
});
|
||||
|
||||
it('should call API to fetch secondary parent paths', () => {
|
||||
@@ -282,8 +282,8 @@ describe('NodeInformationComponent', () => {
|
||||
expect(getNodeName()).toBe('mock-file-link');
|
||||
expect(getNodeSize()).toBe('APP.NODE_INFO.NOT_AVAILABLE');
|
||||
expect(getNodeLocation()).toBe('mock-file-link-path');
|
||||
expect(getNodeCreationDate()).toBe('2/1/24, 11:11 AM');
|
||||
expect(getNodeModifyDate()).toBe('3/2/24, 10:22 PM');
|
||||
expect(getNodeCreationDate()).toBe('2/1/24, 11:11 AM');
|
||||
expect(getNodeModifyDate()).toBe('3/2/24, 10:22 PM');
|
||||
expect(nodeService.initiateFolderSizeCalculation).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -296,8 +296,8 @@ describe('NodeInformationComponent', () => {
|
||||
expect(getNodeSize()).toBe('APP.NODE_INFO.NOT_AVAILABLE');
|
||||
expect(getNumberOfFiles()).toBe('APP.NODE_INFO.NOT_AVAILABLE');
|
||||
expect(getNodeLocation()).toBe('mock-folder-link-path');
|
||||
expect(getNodeCreationDate()).toBe('2/1/24, 11:11 AM');
|
||||
expect(getNodeModifyDate()).toBe('3/2/24, 10:22 PM');
|
||||
expect(getNodeCreationDate()).toBe('2/1/24, 11:11 AM');
|
||||
expect(getNodeModifyDate()).toBe('3/2/24, 10:22 PM');
|
||||
expect(nodeService.initiateFolderSizeCalculation).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user