mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-24 17:31:52 +00:00
[ACS-4538] Make folder-rules secondary entry point of aca-content (#3181)
* [ACS-4538] Make folder-rules secondary entry point of aca-content * [ACA-4538] Fix folder rules imports * [ACS-4538] Fix folder-rules unit tests * [ACS-4538] Fix package.json after folder rules transition * [ACS-4538] Remove duplicated peerDependency * [ACS-4538] Import fix
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
/*!
|
||||
* Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Alfresco Example Content Application
|
||||
*
|
||||
* This file is part of the Alfresco Example Content Application.
|
||||
* If the software was purchased under a paid Alfresco license, the terms of
|
||||
* the paid license agreement will prevail. Otherwise, the software is
|
||||
* provided under the following open source license terms:
|
||||
*
|
||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* from Hyland Software. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { RuleListUiComponent } from './rule-list.ui-component';
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule } from '@alfresco/adf-core';
|
||||
import { RuleListGroupingUiComponent } from '../rule-list-grouping/rule-list-grouping.ui-component';
|
||||
import { RuleListItemUiComponent } from '../rule-list-item/rule-list-item.ui-component';
|
||||
import { ownedRuleSetMock, ruleSetsMock, ruleSetWithLinkMock } from '../../mock/rule-sets.mock';
|
||||
import { DebugElement } from '@angular/core';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { owningFolderIdMock } from '../../mock/node.mock';
|
||||
|
||||
describe('RuleListUiComponent', () => {
|
||||
let fixture: ComponentFixture<RuleListUiComponent>;
|
||||
let component: RuleListUiComponent;
|
||||
let debugElement: DebugElement;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule],
|
||||
declarations: [RuleListUiComponent, RuleListGroupingUiComponent, RuleListItemUiComponent]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(RuleListUiComponent);
|
||||
component = fixture.componentInstance;
|
||||
debugElement = fixture.debugElement;
|
||||
|
||||
component.folderId = owningFolderIdMock;
|
||||
component.inheritedRuleSets = ruleSetsMock;
|
||||
});
|
||||
|
||||
it('should show "Rules from current folder" as a title if the main rule set is owned', () => {
|
||||
component.mainRuleSet = ownedRuleSetMock;
|
||||
fixture.detectChanges();
|
||||
|
||||
const mainRuleSetTitleElement = debugElement.query(By.css(`[data-automation-id="main-rule-set-title"]`));
|
||||
expect((mainRuleSetTitleElement.nativeElement as HTMLDivElement).innerText.trim()).toBe('ACA_FOLDER_RULES.RULE_LIST.OWNED_RULES');
|
||||
});
|
||||
|
||||
it('should show "Rules from linked folder" as a title if the main rule set is linked', () => {
|
||||
component.mainRuleSet = ruleSetWithLinkMock;
|
||||
fixture.detectChanges();
|
||||
|
||||
const mainRuleSetTitleElement = debugElement.query(By.css(`[data-automation-id="main-rule-set-title"]`));
|
||||
expect((mainRuleSetTitleElement.nativeElement as HTMLDivElement).innerText.trim()).toBe('ACA_FOLDER_RULES.RULE_LIST.LINKED_RULES');
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user