mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-01 14:41:32 +00:00
[ADF-852] Form style Material 2 (#2151)
* mdl2 transition part form 1 * hyperlink * radio buttons * label * people component * [ADF-852] moved textarea to new angular material * number widget * change error multiline * [ADF-852] added md desgin for dropdown * [ADF-852] removed unused css file * functional widget * error dropdown * [ADF-852] - changed to new md date * remove md-date-time-picker dependency in ng2-alfresco-from * [ADF-852] conversion dynamic table phase 1 * container widget * remove test unused * validation change * [ADF-852] convert dynamic table phase 2 * [ADF-852] improving style and fixing bugs * move custom style for form in form.scss * error footer refactor * fix models and test * [ADF-852]- fixed minor twitch on dynamic table * align fields and fix tests dropdown * disabling button in readonly clean mdl form start process form * align dropdown * [ADF-1048] Upload widget can manage multiple files. (#2134) * [ADF-1048] improving upload widget * [ADF-1048] added ability to upload multiple file on upload widget * [ADF-1048] added multiple upload elements on upload widget * [ADF-1048] - show all the files on the completed form * [ADF-1048] fixed wrong selecion on displya upload * [ADF-1048] removed fdescribe from upload widget * date validation and custom moment data adapter * move content widget in the widget folder * add style fields and theming * color primary radio and checkbox * fix amount widget and colors * change ViewEncapsulation and fix date style button issue * empty form customization 1736 * focus label style * [ADF-224] fix the rendering of custom stencils when form is opened in readonly state. (#2161) * [ADF-224] Fixed rendering of custom stencil in readonly mode * [ADF-224] improved variable name * test fix * container filter in form model creation * show display value correctly * fix change date and test * fix date editor and add some test coverage for date * style minor issue * fix new unused local import rule * fix test date * strict date check * fix analytics failing test * restore null as default in model * unify model diagrams and analytics
This commit is contained in:
committed by
Mario Romano
parent
47ea517ffb
commit
083c9da0d4
@@ -15,7 +15,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { ElementRef } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreModule } from 'ng2-alfresco-core';
|
||||
import { ActivitiAlfrescoContentService } from '../../services/activiti-alfresco.service';
|
||||
@@ -30,12 +29,9 @@ describe('WidgetComponent', () => {
|
||||
let widget: WidgetComponent;
|
||||
let fixture: ComponentFixture<WidgetComponent>;
|
||||
let element: HTMLElement;
|
||||
let componentHandler;
|
||||
let formService: FormService;
|
||||
|
||||
beforeEach(async(() => {
|
||||
componentHandler = jasmine.createSpyObj('componentHandler', ['upgradeAllRegistered', 'upgradeElement']);
|
||||
window['componentHandler'] = componentHandler;
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
CoreModule.forRoot()
|
||||
@@ -71,16 +67,6 @@ describe('WidgetComponent', () => {
|
||||
|
||||
});
|
||||
|
||||
it('should upgrade MDL content on view init', () => {
|
||||
widget.ngAfterViewInit();
|
||||
expect(componentHandler.upgradeAllRegistered).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should setup MDL content only if component handler available', () => {
|
||||
expect(widget.setupMaterialComponents(componentHandler)).toBeTruthy();
|
||||
expect(widget.setupMaterialComponents()).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should check field', () => {
|
||||
expect(widget.hasField()).toBeFalsy();
|
||||
widget.field = new FormFieldModel(new FormModel());
|
||||
@@ -128,35 +114,4 @@ describe('WidgetComponent', () => {
|
||||
expect(widget.isRequired()).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should require element reference to setup textfield', () => {
|
||||
expect(widget.setupMaterialTextField(null, {}, 'value')).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should require component handler to setup textfield', () => {
|
||||
let elementRef = new ElementRef(null);
|
||||
expect(widget.setupMaterialTextField(elementRef, null, 'value')).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should require field value to setup textfield', () => {
|
||||
let elementRef = new ElementRef(null);
|
||||
expect(widget.setupMaterialTextField(elementRef, {}, null)).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should setup textfield', () => {
|
||||
let changeCalled = false;
|
||||
let elementRef = new ElementRef({
|
||||
querySelector: function () {
|
||||
return {
|
||||
MaterialTextfield: {
|
||||
change: function () {
|
||||
changeCalled = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
expect(widget.setupMaterialTextField(elementRef, {}, 'value')).toBeTruthy();
|
||||
expect(changeCalled).toBeTruthy();
|
||||
});
|
||||
|
||||
});
|
||||
|
Reference in New Issue
Block a user