mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
committed by
Eugenio Romano
parent
53d96679ea
commit
e39a2b149b
@@ -111,7 +111,7 @@ describe('CardViewBoolItemComponent', () => {
|
||||
expect(value.nativeElement.checked).toBe(true);
|
||||
});
|
||||
|
||||
it('should render unticked checkbox if property value is false', () => {
|
||||
it('should render un-ticked checkbox if property value is false', () => {
|
||||
component.property.value = false;
|
||||
fixture.detectChanges();
|
||||
|
||||
@@ -120,7 +120,7 @@ describe('CardViewBoolItemComponent', () => {
|
||||
expect(value.nativeElement.checked).toBe(false);
|
||||
});
|
||||
|
||||
it('should render unticked checkbox if property value is not set but default is false and editable', () => {
|
||||
it('should render un-ticked checkbox if property value is not set but default is false and editable', () => {
|
||||
component.editable = true;
|
||||
component.property.editable = true;
|
||||
component.property.value = undefined;
|
||||
|
@@ -39,7 +39,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
component.property = new CardViewDateItemModel({
|
||||
label: 'Date label',
|
||||
value: new Date('07/10/2017'),
|
||||
key: 'datekey',
|
||||
key: 'dateKey',
|
||||
default: '',
|
||||
format: '',
|
||||
editable: false
|
||||
@@ -66,7 +66,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
component.property = new CardViewDateItemModel({
|
||||
label: 'Date label',
|
||||
value: '',
|
||||
key: 'datekey',
|
||||
key: 'dateKey',
|
||||
default: 'FAKE-DEFAULT-KEY',
|
||||
format: '',
|
||||
editable: false
|
||||
@@ -84,7 +84,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
component.property = new CardViewDateItemModel({
|
||||
label: 'Date label',
|
||||
value: '',
|
||||
key: 'datekey',
|
||||
key: 'dateKey',
|
||||
default: 'FAKE-DEFAULT-KEY',
|
||||
format: '',
|
||||
editable: false
|
||||
@@ -102,7 +102,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
component.property = new CardViewDateItemModel({
|
||||
label: 'Date label',
|
||||
value: '',
|
||||
key: 'datekey',
|
||||
key: 'dateKey',
|
||||
default: 'FAKE-DEFAULT-KEY',
|
||||
format: '',
|
||||
editable: true
|
||||
@@ -157,7 +157,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
expect(datePickerToggle).toBeNull('Datepicker toggle should NOT be shown');
|
||||
});
|
||||
|
||||
it('should open the dateXXXpicker when clicking on the label', () => {
|
||||
it('should open the datepicker when clicking on the label', () => {
|
||||
component.editable = true;
|
||||
component.property.editable = true;
|
||||
fixture.detectChanges();
|
||||
@@ -179,7 +179,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
let disposableUpdate = cardViewUpdateService.itemUpdated$.subscribe(
|
||||
(updateNotification) => {
|
||||
expect(updateNotification.target).toBe(component.property);
|
||||
expect(updateNotification.changed).toEqual({ datekey: expectedDate.toDate() });
|
||||
expect(updateNotification.changed).toEqual({ dateKey: expectedDate.toDate() });
|
||||
disposableUpdate.unsubscribe();
|
||||
done();
|
||||
}
|
||||
@@ -188,7 +188,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
component.onDateChanged({ value: expectedDate });
|
||||
});
|
||||
|
||||
it('should update the propery\'s value after a succesful update attempt', async(() => {
|
||||
it('should update the property value after a successful update attempt', async(() => {
|
||||
component.editable = true;
|
||||
component.property.editable = true;
|
||||
component.property.value = null;
|
||||
|
@@ -65,7 +65,7 @@ export class CardViewDateItemComponent implements OnInit {
|
||||
this.preferences.locale$.subscribe((locale) => {
|
||||
this.dateAdapter.setLocale(locale);
|
||||
});
|
||||
(<MomentDateAdapter> this.dateAdapter).overrideDisplyaFormat = this.SHOW_FORMAT;
|
||||
(<MomentDateAdapter> this.dateAdapter).overrideDisplayFormat = this.SHOW_FORMAT;
|
||||
|
||||
if (this.property.value) {
|
||||
this.valueDate = moment(this.property.value, this.SHOW_FORMAT);
|
||||
|
@@ -89,7 +89,7 @@ describe('CardViewItemDispatcherComponent', () => {
|
||||
TestBed.resetTestingModule();
|
||||
});
|
||||
|
||||
describe('Subcompomnent creation', () => {
|
||||
describe('Sub-component creation', () => {
|
||||
|
||||
it('should load the CardViewShinyCustomElementItemComponent', () => {
|
||||
const innerElement = fixture.debugElement.query(By.css('[data-automation-id="found-me"]'));
|
||||
@@ -136,7 +136,7 @@ describe('CardViewItemDispatcherComponent', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Angular lifecycle methods', () => {
|
||||
describe('Angular life-cycle methods', () => {
|
||||
|
||||
let shinyCustomElementItemComponent;
|
||||
|
||||
@@ -155,7 +155,7 @@ describe('CardViewItemDispatcherComponent', () => {
|
||||
shinyCustomElementItemComponent = fixture.debugElement.query(By.css('whatever-you-want-to-have')).componentInstance;
|
||||
});
|
||||
|
||||
it('should call through the lifecycle methods', () => {
|
||||
it('should call through the life-cycle methods', () => {
|
||||
lifeCycleMethods.forEach((lifeCycleMethod) => {
|
||||
shinyCustomElementItemComponent[lifeCycleMethod] = () => {};
|
||||
spyOn(shinyCustomElementItemComponent, lifeCycleMethod);
|
||||
@@ -167,7 +167,7 @@ describe('CardViewItemDispatcherComponent', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should NOT call through the lifecycle methods if the method does not exist (no error should be thrown)', () => {
|
||||
it('should NOT call through the life-cycle methods if the method does not exist (no error should be thrown)', () => {
|
||||
const param = {};
|
||||
lifeCycleMethods.forEach((lifeCycleMethod) => {
|
||||
shinyCustomElementItemComponent[lifeCycleMethod] = undefined;
|
||||
|
@@ -53,7 +53,7 @@ export class CardViewItemDispatcherComponent implements OnChanges {
|
||||
|
||||
constructor(private cardItemTypeService: CardItemTypeService,
|
||||
private resolver: ComponentFactoryResolver) {
|
||||
const dynamicLifecycleMethods = [
|
||||
const dynamicLifeCycleMethods = [
|
||||
'ngOnInit',
|
||||
'ngDoCheck',
|
||||
'ngAfterContentInit',
|
||||
@@ -63,8 +63,8 @@ export class CardViewItemDispatcherComponent implements OnChanges {
|
||||
'ngOnDestroy'
|
||||
];
|
||||
|
||||
dynamicLifecycleMethods.forEach((dynamicLifecycleMethod) => {
|
||||
this[dynamicLifecycleMethod] = this.proxy.bind(this, dynamicLifecycleMethod);
|
||||
dynamicLifeCycleMethods.forEach(method => {
|
||||
this[method] = this.proxy.bind(this, method);
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -289,7 +289,7 @@ describe('CardViewTextItemComponent', () => {
|
||||
expect(component.errorMessages).toBe(expectedErrorMessages);
|
||||
});
|
||||
|
||||
it('should update the propery\'s value after a succesful update attempt', async(() => {
|
||||
it('should update the property value after a successful update attempt', async(() => {
|
||||
component.property.isValid = () => true;
|
||||
component.update();
|
||||
|
||||
|
Reference in New Issue
Block a user