diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/centerFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/centerFormatter.spec.ts
index aca11c7ef..96fd2a446 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/centerFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/centerFormatter.spec.ts
@@ -3,13 +3,13 @@ import { centerFormatter } from '../centerFormatter';
describe('Center Alignment Formatter', () => {
it('should return an empty string when no value is passed', () => {
- const output = centerFormatter(1, 1, '', {} as Column, {});
+ const output = centerFormatter(1, 1, '', {} as Column, {}, {});
expect(output).toBe('');
});
it('should return an empty string when value is null or undefined', () => {
- const output1 = centerFormatter(1, 1, null, {} as Column, {});
- const output2 = centerFormatter(1, 1, undefined, {} as Column, {});
+ const output1 = centerFormatter(1, 1, null, {} as Column, {}, {});
+ const output2 = centerFormatter(1, 1, undefined, {} as Column, {}, {});
expect(output1).toBe('');
expect(output2).toBe('');
@@ -17,17 +17,17 @@ describe('Center Alignment Formatter', () => {
it('should return a string all in uppercase', () => {
- const output = centerFormatter(1, 1, 'hello', {} as Column, {});
+ const output = centerFormatter(1, 1, 'hello', {} as Column, {}, {});
expect(output).toBe('hello');
});
it('should return a number as a string', () => {
- const output = centerFormatter(1, 1, 99, {} as Column, {});
+ const output = centerFormatter(1, 1, 99, {} as Column, {}, {});
expect(output).toBe('99');
});
it('should return a boolean as a string all in uppercase', () => {
- const output = centerFormatter(1, 1, false, {} as Column, {});
+ const output = centerFormatter(1, 1, false, {} as Column, {}, {});
expect(output).toBe('false');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/checkboxFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/checkboxFormatter.spec.ts
index bce780a3c..7966f703c 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/checkboxFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/checkboxFormatter.spec.ts
@@ -4,25 +4,25 @@ import { checkboxFormatter } from '../checkboxFormatter';
describe('the Checkbox Formatter', () => {
it('should return an empty string when no value is passed', () => {
const value = null;
- const result = checkboxFormatter(0, 0, value, {} as Column, {});
+ const result = checkboxFormatter(0, 0, value, {} as Column, {}, {});
expect(result).toBe('');
});
it('should return an empty string when False is provided', () => {
const value = false;
- const result = checkboxFormatter(0, 0, value, {} as Column, {});
+ const result = checkboxFormatter(0, 0, value, {} as Column, {}, {});
expect(result).toBe('');
});
it('should return the unicode value of a checkbox when input is True', () => {
const value = true;
- const result = checkboxFormatter(0, 0, value, {} as Column, {});
+ const result = checkboxFormatter(0, 0, value, {} as Column, {}, {});
expect(result).toBe('☑');
});
it('should return the unicode value of a checkbox when input is filled with any string', () => {
const value = 'anything';
- const result = checkboxFormatter(0, 0, value, {} as Column, {});
+ const result = checkboxFormatter(0, 0, value, {} as Column, {}, {});
expect(result).toBe('☑');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/checkmarkFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/checkmarkFormatter.spec.ts
index 37daa19da..2da175602 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/checkmarkFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/checkmarkFormatter.spec.ts
@@ -4,67 +4,67 @@ import { checkmarkFormatter } from '../checkmarkFormatter';
describe('the Checkmark Formatter', () => {
it('should return an empty string when no value is passed', () => {
const value = null;
- const result = checkmarkFormatter(0, 0, value, {} as Column, {});
+ const result = checkmarkFormatter(0, 0, value, {} as Column, {}, {});
expect(result).toBe('');
});
it('should return an empty string when False is provided', () => {
const value = false;
- const result = checkmarkFormatter(0, 0, value, {} as Column, {});
+ const result = checkmarkFormatter(0, 0, value, {} as Column, {}, {});
expect(result).toBe('');
});
it('should return an empty string when the string "FALSE" (case insensitive) is provided', () => {
const value = 'FALSE';
- const result1 = checkmarkFormatter(0, 0, value.toLowerCase(), {} as Column, {});
- const result2 = checkmarkFormatter(0, 0, value.toUpperCase(), {} as Column, {});
+ const result1 = checkmarkFormatter(0, 0, value.toLowerCase(), {} as Column, {}, {});
+ const result2 = checkmarkFormatter(0, 0, value.toUpperCase(), {} as Column, {}, {});
expect(result1).toBe('');
expect(result2).toBe('');
});
it('should return the Font Awesome Checkmark icon when the string "True" (case insensitive) is provided', () => {
const value = 'True';
- const result1 = checkmarkFormatter(0, 0, value.toLowerCase(), {} as Column, {});
- const result2 = checkmarkFormatter(0, 0, value.toUpperCase(), {} as Column, {});
+ const result1 = checkmarkFormatter(0, 0, value.toLowerCase(), {} as Column, {}, {});
+ const result2 = checkmarkFormatter(0, 0, value.toUpperCase(), {} as Column, {}, {});
expect(result1).toBe('');
expect(result2).toBe('');
});
it('should return the Font Awesome Checkmark icon when input is True', () => {
const value = true;
- const result = checkmarkFormatter(0, 0, value, {} as Column, {});
+ const result = checkmarkFormatter(0, 0, value, {} as Column, {}, {});
expect(result).toBe('');
});
it('should return the Font Awesome Checkmark icon when input is a string even if it start with 0', () => {
const value = '005A00ABC';
- const result1 = checkmarkFormatter(0, 0, value, {} as Column, {});
+ const result1 = checkmarkFormatter(0, 0, value, {} as Column, {}, {});
expect(result1).toBe('');
});
it('should return an empty string when the string "0" is provided', () => {
const value = '0';
- const result = checkmarkFormatter(0, 0, value, {} as Column, {});
+ const result = checkmarkFormatter(0, 0, value, {} as Column, {}, {});
expect(result).toBe('');
});
it('should return the Font Awesome Checkmark icon when input is a number greater than 0', () => {
const value = 0.000001;
- const result1 = checkmarkFormatter(0, 0, value, {} as Column, {});
+ const result1 = checkmarkFormatter(0, 0, value, {} as Column, {}, {});
expect(result1).toBe('');
});
it('should return the Font Awesome Checkmark icon when input is a number as a text greater than 0', () => {
const value = '0.000001';
- const result1 = checkmarkFormatter(0, 0, value, {} as Column, {});
+ const result1 = checkmarkFormatter(0, 0, value, {} as Column, {}, {});
expect(result1).toBe('');
});
it('should return an empty string when input is a number lower or equal to 0', () => {
const value1 = 0;
const value2 = -0.5;
- const result1 = checkmarkFormatter(0, 0, value1, {} as Column, {});
- const result2 = checkmarkFormatter(0, 0, value2, {} as Column, {});
+ const result1 = checkmarkFormatter(0, 0, value1, {} as Column, {}, {});
+ const result2 = checkmarkFormatter(0, 0, value2, {} as Column, {}, {});
expect(result1).toBe('');
expect(result2).toBe('');
});
@@ -72,8 +72,8 @@ describe('the Checkmark Formatter', () => {
it('should return an empty string when input is a number as a text and lower or equal to 0', () => {
const value1 = '0';
const value2 = '-0.5';
- const result1 = checkmarkFormatter(0, 0, value1, {} as Column, {});
- const result2 = checkmarkFormatter(0, 0, value2, {} as Column, {});
+ const result1 = checkmarkFormatter(0, 0, value1, {} as Column, {}, {});
+ const result2 = checkmarkFormatter(0, 0, value2, {} as Column, {}, {});
expect(result1).toBe('');
expect(result2).toBe('');
});
@@ -81,8 +81,8 @@ describe('the Checkmark Formatter', () => {
it('should return an empty string when input is type null or undefined', () => {
const value1 = null;
const value2 = undefined;
- const result1 = checkmarkFormatter(0, 0, value1, {} as Column, {});
- const result2 = checkmarkFormatter(0, 0, value2, {} as Column, {});
+ const result1 = checkmarkFormatter(0, 0, value1, {} as Column, {}, {});
+ const result2 = checkmarkFormatter(0, 0, value2, {} as Column, {}, {});
expect(result1).toBe('');
expect(result2).toBe('');
});
@@ -90,8 +90,8 @@ describe('the Checkmark Formatter', () => {
it('should return the Font Awesome Checkmark icon when input is the "null" or "undefined"', () => {
const value1 = 'null';
const value2 = 'undefined';
- const result1 = checkmarkFormatter(0, 0, value1, {} as Column, {});
- const result2 = checkmarkFormatter(0, 0, value2, {} as Column, {});
+ const result1 = checkmarkFormatter(0, 0, value1, {} as Column, {}, {});
+ const result2 = checkmarkFormatter(0, 0, value2, {} as Column, {}, {});
expect(result1).toBe('');
expect(result2).toBe('');
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/collectionEditorFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/collectionEditorFormatter.spec.ts
index 917c1c6b9..646e3ea04 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/collectionEditorFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/collectionEditorFormatter.spec.ts
@@ -17,25 +17,25 @@ describe('the CollectionEditor Formatter', () => {
it('should return same output when no value is passed', () => {
const valueArray = null;
- const result = collectionEditorFormatter(0, 0, valueArray, {} as Column, {});
+ const result = collectionEditorFormatter(0, 0, valueArray, {} as Column, {}, {});
expect(result).toBe(null);
});
it('should return an empty array when value passed is an empty array', () => {
const valueArray = [];
- const result = collectionEditorFormatter(0, 0, valueArray, {} as Column, {});
+ const result = collectionEditorFormatter(0, 0, valueArray, {} as Column, {}, {});
expect(result).toEqual([]);
});
it('should return original value when input is not an array', () => {
const inputValue = 'anything';
- const result = collectionEditorFormatter(0, 0, inputValue, {} as Column, {});
+ const result = collectionEditorFormatter(0, 0, inputValue, {} as Column, {}, {});
expect(result).toBe(inputValue);
});
it('should return a CSV string when provided collection is an array of objects', () => {
const valueArray = [1, 2];
- const result = collectionEditorFormatter(0, 0, valueArray, columnDef, {});
+ const result = collectionEditorFormatter(0, 0, valueArray, columnDef, {}, {});
const outputCsv = 'foo, bar';
expect(result).toBe(`${outputCsv}`);
});
@@ -44,7 +44,7 @@ describe('the CollectionEditor Formatter', () => {
const valueArray = ['foo', 'bar'];
columnDef.editor.collection = ['foo', 'bar', 'apple'];
- const result = collectionEditorFormatter(0, 0, valueArray, columnDef, {});
+ const result = collectionEditorFormatter(0, 0, valueArray, columnDef, {}, {});
const outputCsv = 'foo, bar';
expect(result).toBe(`${outputCsv}`);
@@ -55,7 +55,7 @@ describe('the CollectionEditor Formatter', () => {
columnDef.editor.collection = [{ id: 1, name: 'John' }, { id: 2, name: 'Bob' }];
columnDef.editor.customStructure = { label: 'name', value: 'id' };
- const result = collectionEditorFormatter(0, 0, valueArray, columnDef, {});
+ const result = collectionEditorFormatter(0, 0, valueArray, columnDef, {}, {});
const outputCsv = 'John, Bob';
expect(result).toBe(`${outputCsv}`);
@@ -63,13 +63,13 @@ describe('the CollectionEditor Formatter', () => {
it('should return a string when provided input value is an object', () => {
const inputValue = 2;
- const result = collectionEditorFormatter(0, 0, inputValue, columnDef, {});
+ const result = collectionEditorFormatter(0, 0, inputValue, columnDef, {}, {});
expect(result).toBe('bar');
});
it('should return an empty string when provided input value is an object that is not part of the collection', () => {
const inputValue = 4;
- const result = collectionEditorFormatter(0, 0, inputValue, columnDef, {});
+ const result = collectionEditorFormatter(0, 0, inputValue, columnDef, {}, {});
expect(result).toBe('');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/collectionFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/collectionFormatter.spec.ts
index b4b4cabd2..9e0edebdc 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/collectionFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/collectionFormatter.spec.ts
@@ -4,26 +4,26 @@ import { collectionFormatter } from '../collectionFormatter';
describe('the Collection Formatter', () => {
it('should return same output when no value is passed', () => {
const valueArray = null;
- const result = collectionFormatter(0, 0, valueArray, {} as Column, {});
+ const result = collectionFormatter(0, 0, valueArray, {} as Column, {}, {});
expect(result).toBe(null);
});
it('should return an empty array when value passed is an empty array', () => {
const valueArray = [];
- const result = collectionFormatter(0, 0, valueArray, {} as Column, {});
+ const result = collectionFormatter(0, 0, valueArray, {} as Column, {}, {});
expect(result).toEqual([]);
});
it('should return original value when input is not an array', () => {
const inputValue = 'anything';
- const result = collectionFormatter(0, 0, inputValue, {} as Column, {});
+ const result = collectionFormatter(0, 0, inputValue, {} as Column, {}, {});
expect(result).toBe(inputValue);
});
it('should return a CSV string when value passed is an array of objects', () => {
const valueArray = [1, 2];
const columnDef = { params: { collection: [{ value: 1, label: 'foo' }, { value: 2, label: 'bar' }] } } as Column;
- const result = collectionFormatter(0, 0, valueArray, columnDef, {});
+ const result = collectionFormatter(0, 0, valueArray, columnDef, {}, {});
const outputCsv = 'foo, bar';
expect(result).toBe(`${outputCsv}`);
});
@@ -36,7 +36,7 @@ describe('the Collection Formatter', () => {
customStructure: { label: 'name', value: 'id' }
}
} as Column;
- const result = collectionFormatter(0, 0, valueArray, columnDef, {});
+ const result = collectionFormatter(0, 0, valueArray, columnDef, {}, {});
const outputCsv = 'John, Bob';
expect(result).toBe(`${outputCsv}`);
});
@@ -44,14 +44,14 @@ describe('the Collection Formatter', () => {
it('should return a string when value passed is an object', () => {
const inputValue = 2;
const columnDef = { params: { collection: [{ value: 1, label: 'foo' }, { value: 2, label: 'bar' }] } } as Column;
- const result = collectionFormatter(0, 0, inputValue, columnDef, {});
+ const result = collectionFormatter(0, 0, inputValue, columnDef, {}, {});
expect(result).toBe('bar');
});
it('should return an empty string when value passed is an object that is not part of the collection', () => {
const inputValue = 4;
const columnDef = { params: { collection: [{ value: 1, label: 'foo' }, { value: 2, label: 'bar' }] } } as Column;
- const result = collectionFormatter(0, 0, inputValue, columnDef, {});
+ const result = collectionFormatter(0, 0, inputValue, columnDef, {}, {});
expect(result).toBe('');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/complexObjectFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/complexObjectFormatter.spec.ts
index fb74c3e78..79520f506 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/complexObjectFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/complexObjectFormatter.spec.ts
@@ -11,54 +11,54 @@ describe('the ComplexObject Formatter', () => {
];
it('should throw an error when omitting to pass "complexFieldLabel" to "params"', () => {
- expect(() => complexObjectFormatter(0, 0, 'anything', {} as Column, {}))
+ expect(() => complexObjectFormatter(0, 0, 'anything', {} as Column, {}, {}))
.toThrowError('For the Formatters.complexObject to work properly');
});
it('should return empty string when no column definition is provided', () => {
- const result = complexObjectFormatter(0, 0, 'anything', null as Column, {});
+ const result = complexObjectFormatter(0, 0, 'anything', null as Column, {}, {});
expect(result).toBe('');
});
it('should return original input value when the "field" property does not include a not ".", neither "complexFieldLabel"', () => {
- const result = complexObjectFormatter(0, 0, 'anything', { field: 'role' } as Column, {});
+ const result = complexObjectFormatter(0, 0, 'anything', { field: 'role' } as Column, {}, {});
expect(result).toBe('anything');
});
it('should return original input value when the "field" property was not found in the data context object', () => {
- const result = complexObjectFormatter(0, 0, 'anything', { field: 'invalid.object' } as Column, dataset[2]);
+ const result = complexObjectFormatter(0, 0, 'anything', { field: 'invalid.object' } as Column, dataset[2], {});
expect(result).toBe('anything');
});
it('should return original input value when the "complexFieldLabel" does not include a not "." within its string', () => {
const params = { complexFieldLabel: 'name' };
- const result = complexObjectFormatter(0, 0, 'anything', { field: 'role', params } as Column, {});
+ const result = complexObjectFormatter(0, 0, 'anything', { field: 'role', params } as Column, {}, {});
expect(result).toBe('anything');
});
it('should return original input value when the "complexFieldLabel" was not found in the data context object', () => {
const params = { complexFieldLabel: 'invalid.object' };
- const result = complexObjectFormatter(0, 0, 'anything', { field: 'role', params } as Column, dataset[2]);
+ const result = complexObjectFormatter(0, 0, 'anything', { field: 'role', params } as Column, dataset[2], {});
expect(result).toBe('anything');
});
it('should return the value from the complex object when "field" property with dot notation was found in the data context object', () => {
const expectedOutput = 'Administrator';
- const result = complexObjectFormatter(0, 0, 'anything', { field: 'role.name' } as Column, dataset[0]);
+ const result = complexObjectFormatter(0, 0, 'anything', { field: 'role.name' } as Column, dataset[0], {});
expect(result).toBe(expectedOutput);
});
it('should return the value from the complex object when "complexFieldLabel" property with dot notation was found in the data context object', () => {
const params = { complexFieldLabel: 'role.name' };
const expectedOutput = 'Administrator';
- const result = complexObjectFormatter(0, 0, 'anything', { field: 'role', params } as Column, dataset[0]);
+ const result = complexObjectFormatter(0, 0, 'anything', { field: 'role', params } as Column, dataset[0], {});
expect(result).toBe(expectedOutput);
});
it('should return the value from the complex object when "complexFieldLabel" is not dot notation but has a "labelKey" was found in the data context object', () => {
const params = { complexFieldLabel: 'role' };
const expectedOutput = 'Administrator';
- const result = complexObjectFormatter(0, 0, 'anything', { field: 'role', labelKey: 'name', params } as Column, dataset[0]);
+ const result = complexObjectFormatter(0, 0, 'anything', { field: 'role', labelKey: 'name', params } as Column, dataset[0], {});
expect(result).toBe(expectedOutput);
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/dateEuroFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/dateEuroFormatter.spec.ts
index b6a36e208..fc03777e4 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/dateEuroFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/dateEuroFormatter.spec.ts
@@ -4,25 +4,31 @@ import { Formatters } from '../index';
describe('the DateEuro Formatter', () => {
it('should return null when no value is provided', () => {
const value = null;
- const result = Formatters.dateEuro(0, 0, value, {} as Column, {});
+ const result = Formatters.dateEuro(0, 0, value, {} as Column, {}, {});
expect(result).toBe(null);
});
it('should return original string when input value provided is not a valid date', () => {
const value = 'TBD';
- const result = Formatters.dateEuro(0, 0, value, {} as Column, {});
+ const result = Formatters.dateEuro(0, 0, value, {} as Column, {}, {});
expect(result).toBe('TBD');
});
+ it('should provide a dateIso formatted input and return a formatted date value without time when valid date value is provided', () => {
+ const value = '2019-05-03 00:00:01';
+ const result = Formatters.dateEuro(0, 0, value, { input: 'dateIso' } as unknown as Column, {}, {});
+ expect(result).toBe('03/05/2019');
+ });
+
it('should return a formatted date value without time when valid date value is provided', () => {
const value = new Date('2019-05-03T00:00:01');
- const result = Formatters.dateEuro(0, 0, value, {} as Column, {});
+ const result = Formatters.dateEuro(0, 0, value, {} as Column, {}, {});
expect(result).toBe('03/05/2019');
});
it('should return a formatted date value without time when valid date value is provided', () => {
const value = new Date('2019-05-01T02:36:07');
- const result = Formatters.dateEuro(0, 0, value, {} as Column, {});
+ const result = Formatters.dateEuro(0, 0, value, {} as Column, {}, {});
expect(result).toBe('01/05/2019');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/dateIsoFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/dateIsoFormatter.spec.ts
index 3e6669138..915da1cb4 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/dateIsoFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/dateIsoFormatter.spec.ts
@@ -1,37 +1,44 @@
+import { GridOption } from 'dist/public_api';
import { Column } from '../../models';
import { Formatters } from '../index';
describe('the Date ISO Formatter', () => {
it('should return null when no value is provided', () => {
const value = null;
- const result = Formatters.dateIso(0, 0, value, {} as Column, {});
+ const result = Formatters.dateIso(0, 0, value, {} as Column, {}, {});
expect(result).toBe(null);
});
it('should return original string when input value provided is not a valid date', () => {
const value = 'TBD';
- const result = Formatters.dateIso(0, 0, value, {} as Column, {});
+ const result = Formatters.dateIso(0, 0, value, {} as Column, {}, {});
expect(result).toBe('TBD');
});
+ it('should provide a dateIso formatted input and return a formatted date value without time when valid date value is provided', () => {
+ const value = '2019-05-03 00:00:01';
+ const result = Formatters.dateIso(0, 0, value, { input: 'dateIso' } as unknown as Column, {}, {});
+ expect(result).toBe('2019-05-03');
+ });
+
it('should return a formatted date value without time when valid date value is provided', () => {
const value = new Date('2019-05-03T00:00:01');
- const result = Formatters.dateIso(0, 0, value, {} as Column, {});
+ const result = Formatters.dateIso(0, 0, value, {} as Column, {}, {});
expect(result).toBe('2019-05-03');
});
it('should return a formatted date value without time when valid date value is provided', () => {
const value = new Date('2019-05-01T02:36:07');
- const result = Formatters.dateIso(0, 0, value, {} as Column, {});
+ const result = Formatters.dateIso(0, 0, value, {} as Column, {}, {});
expect(result).toBe('2019-05-01');
});
it('should return a formatted date value without time date provided has TZ but we specifically mention to parse as UTC ', () => {
const value = new Date('2099-12-31T00:00:00.000Z');
- const result1 = Formatters.dateIso(0, 0, value, { params: { parseDateAsUtc: true } } as Column, {});
- const result2 = Formatters.dateIso(0, 0, value, { params: { parseDateAsUtc: false } } as Column, {});
- const result3 = Formatters.dateIso(0, 0, value, {} as Column, {});
+ const result1 = Formatters.dateIso(0, 0, value, { params: { parseDateAsUtc: true } } as Column, {}, {});
+ const result2 = Formatters.dateIso(0, 0, value, { params: { parseDateAsUtc: false } } as Column, {}, {});
+ const result3 = Formatters.dateIso(0, 0, value, {} as Column, {}, {});
expect(result1).toBe('2099-12-31');
expect(result2).toBe('2099-12-30');
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeEuroAmPmFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeEuroAmPmFormatter.spec.ts
index 8f3d87ca9..7f5cb55a3 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeEuroAmPmFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeEuroAmPmFormatter.spec.ts
@@ -4,25 +4,31 @@ import { Formatters } from '../index';
describe('the DateTimeShortEuro Formatter', () => {
it('should return null when no value is provided', () => {
const value = null;
- const result = Formatters.dateTimeEuroAmPm(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeEuroAmPm(0, 0, value, {} as Column, {}, {});
expect(result).toBe(null);
});
it('should return original string when input value provided is not a valid date', () => {
const value = 'TBD';
- const result = Formatters.dateTimeEuroAmPm(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeEuroAmPm(0, 0, value, {} as Column, {}, {});
expect(result).toBe('TBD');
});
+ it('should provide a dateIso formatted input and return a formatted date value without time when valid date value is provided', () => {
+ const value = '2019-05-01 02:36:07';
+ const result = Formatters.dateTimeEuroAmPm(0, 0, value, { input: 'dateIso' } as unknown as Column, {}, {});
+ expect(result).toBe('01/05/2019 02:36:07 am');
+ });
+
it('should return a formatted date value in the morning when valid date value is provided', () => {
const value = new Date('2019-05-01T02:36:07');
- const result = Formatters.dateTimeEuroAmPm(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeEuroAmPm(0, 0, value, {} as Column, {}, {});
expect(result).toBe('01/05/2019 02:36:07 am');
});
it('should return a formatted date value in the afternoon when valid date value is provided', () => {
const value = new Date('2019-05-01T20:36:07');
- const result = Formatters.dateTimeEuroAmPm(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeEuroAmPm(0, 0, value, {} as Column, {}, {});
expect(result).toBe('01/05/2019 08:36:07 pm');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeEuroFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeEuroFormatter.spec.ts
index 4484a0408..7051a2cba 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeEuroFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeEuroFormatter.spec.ts
@@ -4,25 +4,31 @@ import { Formatters } from '../index';
describe('the DateTimeEuro Formatter', () => {
it('should return null when no value is provided', () => {
const value = null;
- const result = Formatters.dateTimeEuro(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeEuro(0, 0, value, {} as Column, {}, {});
expect(result).toBe(null);
});
it('should return original string when input value provided is not a valid date', () => {
const value = 'TBD';
- const result = Formatters.dateTimeEuro(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeEuro(0, 0, value, {} as Column, {}, {});
expect(result).toBe('TBD');
});
+ it('should provide a dateIso formatted input and return a formatted date value without time when valid date value is provided', () => {
+ const value = '2019-05-01 02:36:07';
+ const result = Formatters.dateTimeEuro(0, 0, value, { input: 'dateIso' } as unknown as Column, {}, {});
+ expect(result).toBe('01/05/2019 02:36:07');
+ });
+
it('should return a formatted date value in the morning when valid date value is provided', () => {
const value = new Date('2019-05-01T02:36:07');
- const result = Formatters.dateTimeEuro(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeEuro(0, 0, value, {} as Column, {}, {});
expect(result).toBe('01/05/2019 02:36:07');
});
it('should return a formatted date value in the afternoon when valid date value is provided', () => {
const value = new Date('2019-05-01T20:36:07');
- const result = Formatters.dateTimeEuro(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeEuro(0, 0, value, {} as Column, {}, {});
expect(result).toBe('01/05/2019 20:36:07');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeIsoAmPmFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeIsoAmPmFormatter.spec.ts
index bc5ddec6f..992ec90d0 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeIsoAmPmFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeIsoAmPmFormatter.spec.ts
@@ -4,25 +4,31 @@ import { Formatters } from '../index';
describe('the DateTimeIsoAmPm Formatter', () => {
it('should return null when no value is provided', () => {
const value = null;
- const result = Formatters.dateTimeIsoAmPm(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeIsoAmPm(0, 0, value, {} as Column, {}, {});
expect(result).toBe(null);
});
it('should return original string when input value provided is not a valid date', () => {
const value = 'TBD';
- const result = Formatters.dateTimeIsoAmPm(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeIsoAmPm(0, 0, value, {} as Column, {}, {});
expect(result).toBe('TBD');
});
+ it('should provide a dateIso formatted input and return a formatted date value without time when valid date value is provided', () => {
+ const value = '2019-05-01 02:36:07';
+ const result = Formatters.dateTimeIsoAmPm(0, 0, value, { input: 'dateIso' } as unknown as Column, {}, {});
+ expect(result).toBe('2019-05-01 02:36:07 am');
+ });
+
it('should return a formatted date value in the morning when valid date value is provided', () => {
const value = new Date('2019-05-01T02:36:07');
- const result = Formatters.dateTimeIsoAmPm(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeIsoAmPm(0, 0, value, {} as Column, {}, {});
expect(result).toBe('2019-05-01 02:36:07 am');
});
it('should return a formatted date value in the afternoon when valid date value is provided', () => {
const value = new Date('2019-05-01T20:36:07');
- const result = Formatters.dateTimeIsoAmPm(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeIsoAmPm(0, 0, value, {} as Column, {}, {});
expect(result).toBe('2019-05-01 08:36:07 pm');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeIsoFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeIsoFormatter.spec.ts
index 56015afff..0a1965a25 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeIsoFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeIsoFormatter.spec.ts
@@ -4,25 +4,31 @@ import { Formatters } from '../index';
describe('the DateTimeIso Formatter', () => {
it('should return null when no value is provided', () => {
const value = null;
- const result = Formatters.dateTimeIso(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeIso(0, 0, value, {} as Column, {}, {});
expect(result).toBe(null);
});
it('should return original string when input value provided is not a valid date', () => {
const value = 'TBD';
- const result = Formatters.dateTimeIso(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeIso(0, 0, value, {} as Column, {}, {});
expect(result).toBe('TBD');
});
+ it('should provide a dateIso formatted input and return a formatted date value without time when valid date value is provided', () => {
+ const value = '2019-05-01 02:36:07';
+ const result = Formatters.dateTimeIso(0, 0, value, { input: 'dateIso' } as unknown as Column, {}, {});
+ expect(result).toBe('2019-05-01 02:36:07');
+ });
+
it('should return a formatted date value in the morning when valid date value is provided', () => {
const value = new Date('2019-05-01T02:36:07');
- const result = Formatters.dateTimeIso(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeIso(0, 0, value, {} as Column, {}, {});
expect(result).toBe('2019-05-01 02:36:07');
});
it('should return a formatted date value in the afternoon when valid date value is provided', () => {
const value = new Date('2019-05-01T20:36:07');
- const result = Formatters.dateTimeIso(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeIso(0, 0, value, {} as Column, {}, {});
expect(result).toBe('2019-05-01 20:36:07');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeShortEuroFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeShortEuroFormatter.spec.ts
index bb8687380..be4ac0146 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeShortEuroFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeShortEuroFormatter.spec.ts
@@ -4,25 +4,31 @@ import { Formatters } from '../index';
describe('the DateTimeShortEuro Formatter', () => {
it('should return null when no value is provided', () => {
const value = null;
- const result = Formatters.dateTimeShortEuro(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeShortEuro(0, 0, value, {} as Column, {}, {});
expect(result).toBe(null);
});
it('should return original string when input value provided is not a valid date', () => {
const value = 'TBD';
- const result = Formatters.dateTimeShortEuro(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeShortEuro(0, 0, value, {} as Column, {}, {});
expect(result).toBe('TBD');
});
+ it('should provide a dateIso formatted input and return a formatted date value without time when valid date value is provided', () => {
+ const value = '2019-05-01 02:36:07';
+ const result = Formatters.dateTimeShortEuro(0, 0, value, { input: 'dateIso' } as unknown as Column, {}, {});
+ expect(result).toBe('01/05/2019 02:36');
+ });
+
it('should return a formatted date value in the morning when valid date value is provided', () => {
const value = new Date('2019-05-01T02:36:07');
- const result = Formatters.dateTimeShortEuro(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeShortEuro(0, 0, value, {} as Column, {}, {});
expect(result).toBe('01/05/2019 02:36');
});
it('should return a formatted date value in the afternoon when valid date value is provided', () => {
const value = new Date('2019-05-01T20:36:07');
- const result = Formatters.dateTimeShortEuro(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeShortEuro(0, 0, value, {} as Column, {}, {});
expect(result).toBe('01/05/2019 20:36');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeShortIsoFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeShortIsoFormatter.spec.ts
index d42bcc725..decfd386c 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeShortIsoFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeShortIsoFormatter.spec.ts
@@ -4,25 +4,31 @@ import { Formatters } from '../index';
describe('the DateTimeShortIso Formatter', () => {
it('should return null when no value is provided', () => {
const value = null;
- const result = Formatters.dateTimeShortIso(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeShortIso(0, 0, value, {} as Column, {}, {});
expect(result).toBe(null);
});
it('should return original string when input value provided is not a valid date', () => {
const value = 'TBD';
- const result = Formatters.dateTimeShortIso(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeShortIso(0, 0, value, {} as Column, {}, {});
expect(result).toBe('TBD');
});
+ it('should provide a dateIso formatted input and return a formatted date value without time when valid date value is provided', () => {
+ const value = '2019-05-01 02:36:07';
+ const result = Formatters.dateTimeShortIso(0, 0, value, { input: 'dateIso' } as unknown as Column, {}, {});
+ expect(result).toBe('2019-05-01 02:36');
+ });
+
it('should return a formatted date value in the morning when valid date value is provided', () => {
const value = new Date('2019-05-01T02:36:07');
- const result = Formatters.dateTimeShortIso(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeShortIso(0, 0, value, {} as Column, {}, {});
expect(result).toBe('2019-05-01 02:36');
});
it('should return a formatted date value in the afternoon when valid date value is provided', () => {
const value = new Date('2019-05-01T20:36:07');
- const result = Formatters.dateTimeShortIso(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeShortIso(0, 0, value, {} as Column, {}, {});
expect(result).toBe('2019-05-01 20:36');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeShortUsFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeShortUsFormatter.spec.ts
index 93f308bf6..80e719167 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeShortUsFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeShortUsFormatter.spec.ts
@@ -4,25 +4,31 @@ import { Formatters } from '../index';
describe('the DateTimeShortUs Formatter', () => {
it('should return null when no value is provided', () => {
const value = null;
- const result = Formatters.dateTimeShortUs(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeShortUs(0, 0, value, {} as Column, {}, {});
expect(result).toBe(null);
});
it('should return original string when input value provided is not a valid date', () => {
const value = 'TBD';
- const result = Formatters.dateTimeShortUs(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeShortUs(0, 0, value, {} as Column, {}, {});
expect(result).toBe('TBD');
});
+ it('should provide a dateIso formatted input and return a formatted date value without time when valid date value is provided', () => {
+ const value = '2019-05-03 02:36:07';
+ const result = Formatters.dateTimeShortUs(0, 0, value, { input: 'dateIso' } as unknown as Column, {}, {});
+ expect(result).toBe('05/03/2019 02:36');
+ });
+
it('should return a formatted date value in the morning when valid date value is provided', () => {
const value = new Date('2019-05-01T02:36:07');
- const result = Formatters.dateTimeShortUs(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeShortUs(0, 0, value, {} as Column, {}, {});
expect(result).toBe('05/01/2019 02:36');
});
it('should return a formatted date value in the afternoon when valid date value is provided', () => {
const value = new Date('2019-05-01T20:36:07');
- const result = Formatters.dateTimeShortUs(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeShortUs(0, 0, value, {} as Column, {}, {});
expect(result).toBe('05/01/2019 20:36');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeUsAmPmFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeUsAmPmFormatter.spec.ts
index bf63b2874..d8a222114 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeUsAmPmFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeUsAmPmFormatter.spec.ts
@@ -4,25 +4,31 @@ import { Formatters } from '../index';
describe('the DateTimeShortUs Formatter', () => {
it('should return null when no value is provided', () => {
const value = null;
- const result = Formatters.dateTimeUsAmPm(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeUsAmPm(0, 0, value, {} as Column, {}, {});
expect(result).toBe(null);
});
it('should return original string when input value provided is not a valid date', () => {
const value = 'TBD';
- const result = Formatters.dateTimeUsAmPm(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeUsAmPm(0, 0, value, {} as Column, {}, {});
expect(result).toBe('TBD');
});
+ it('should provide a dateIso formatted input and return a formatted date value without time when valid date value is provided', () => {
+ const value = '2019-05-03 02:36:07';
+ const result = Formatters.dateTimeUsAmPm(0, 0, value, { input: 'dateIso' } as unknown as Column, {}, {});
+ expect(result).toBe('05/03/2019 02:36:07 am');
+ });
+
it('should return a formatted date value in the morning when valid date value is provided', () => {
const value = new Date('2019-05-01T02:36:07');
- const result = Formatters.dateTimeUsAmPm(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeUsAmPm(0, 0, value, {} as Column, {}, {});
expect(result).toBe('05/01/2019 02:36:07 am');
});
it('should return a formatted date value in the afternoon when valid date value is provided', () => {
const value = new Date('2019-05-01T20:36:07');
- const result = Formatters.dateTimeUsAmPm(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeUsAmPm(0, 0, value, {} as Column, {}, {});
expect(result).toBe('05/01/2019 08:36:07 pm');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeUsFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeUsFormatter.spec.ts
index 7ca2571bf..4fdbf342e 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeUsFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/dateTimeUsFormatter.spec.ts
@@ -4,25 +4,31 @@ import { Formatters } from '../index';
describe('the DateTimeUs Formatter', () => {
it('should return null when no value is provided', () => {
const value = null;
- const result = Formatters.dateTimeUs(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeUs(0, 0, value, {} as Column, {}, {});
expect(result).toBe(null);
});
it('should return original string when input value provided is not a valid date', () => {
const value = 'TBD';
- const result = Formatters.dateTimeUs(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeUs(0, 0, value, {} as Column, {}, {});
expect(result).toBe('TBD');
});
+ it('should provide a dateIso formatted input and return a formatted date value without time when valid date value is provided', () => {
+ const value = '2019-05-03 02:36:07';
+ const result = Formatters.dateTimeUs(0, 0, value, { input: 'dateIso' } as unknown as Column, {}, {});
+ expect(result).toBe('05/03/2019 02:36:07');
+ });
+
it('should return a formatted date value in the morning when valid date value is provided', () => {
const value = new Date('2019-05-01T02:36:07');
- const result = Formatters.dateTimeUs(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeUs(0, 0, value, {} as Column, {}, {});
expect(result).toBe('05/01/2019 02:36:07');
});
it('should return a formatted date value in the afternoon when valid date value is provided', () => {
const value = new Date('2019-05-01T20:36:07');
- const result = Formatters.dateTimeUs(0, 0, value, {} as Column, {});
+ const result = Formatters.dateTimeUs(0, 0, value, {} as Column, {}, {});
expect(result).toBe('05/01/2019 20:36:07');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/dateUsFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/dateUsFormatter.spec.ts
index fdcad45d7..aac7c0be9 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/dateUsFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/dateUsFormatter.spec.ts
@@ -4,25 +4,31 @@ import { Formatters } from '../index';
describe('the DateUs Formatter', () => {
it('should return null when no value is provided', () => {
const value = null;
- const result = Formatters.dateUs(0, 0, value, {} as Column, {});
+ const result = Formatters.dateUs(0, 0, value, {} as Column, {}, {});
expect(result).toBe(null);
});
it('should return original string when input value provided is not a valid date', () => {
const value = 'TBD';
- const result = Formatters.dateUs(0, 0, value, {} as Column, {});
+ const result = Formatters.dateUs(0, 0, value, {} as Column, {}, {});
expect(result).toBe('TBD');
});
+ it('should provide a dateIso formatted input and return a formatted date value without time when valid date value is provided', () => {
+ const value = '2019-05-03';
+ const result = Formatters.dateUs(0, 0, value, { input: 'dateIso' } as unknown as Column, {}, {});
+ expect(result).toBe('05/03/2019');
+ });
+
it('should return a formatted date value without time when valid date value is provided', () => {
const value = new Date('2019-05-03T00:00:01');
- const result = Formatters.dateUs(0, 0, value, {} as Column, {});
+ const result = Formatters.dateUs(0, 0, value, {} as Column, {}, {});
expect(result).toBe('05/03/2019');
});
- it('should return a formatted date value without time when valid date value is provided', () => {
+ it('should return a second formatted date value without time when valid date value is provided', () => {
const value = new Date('2019-05-01T02:36:07');
- const result = Formatters.dateUs(0, 0, value, {} as Column, {});
+ const result = Formatters.dateUs(0, 0, value, {} as Column, {}, {});
expect(result).toBe('05/01/2019');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/decimalFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/decimalFormatter.spec.ts
index 31c18948b..db2d5d901 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/decimalFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/decimalFormatter.spec.ts
@@ -13,52 +13,52 @@ describe('the Decimal Formatter', () => {
};
it('should display an empty string when no value is provided', () => {
- const output = decimalFormatter(1, 1, '', {} as Column, {});
+ const output = decimalFormatter(1, 1, '', {} as Column, {}, {});
expect(output).toBe('');
});
it('should display original string when non-numeric value is provided', () => {
- const output = decimalFormatter(1, 1, 'hello', {} as Column, {});
+ const output = decimalFormatter(1, 1, 'hello', {} as Column, {}, {});
expect(output).toBe('hello');
});
it('should display $0 when number 0 is provided', () => {
const input = 0;
- const output = decimalFormatter(1, 1, input, {} as Column, {});
+ const output = decimalFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe('0.00');
});
it('should display a number with negative dollar sign when a negative number is provided', () => {
const input = -15;
- const output = decimalFormatter(1, 1, input, {} as Column, {});
+ const output = decimalFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe('-15.00');
});
it('should display a number with dollar sign when a number is provided', () => {
const input = 99;
- const output = decimalFormatter(1, 1, input, {} as Column, {});
+ const output = decimalFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe('99.00');
});
it('should display a number with dollar sign when a string number is provided', () => {
const input = '99';
- const output = decimalFormatter(1, 1, input, {} as Column, {});
+ const output = decimalFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe('99.00');
});
it('should display a number with dollar sign and use "minDecimal" params', () => {
const input = 99.1;
- const output = decimalFormatter(1, 1, input, { params: { minDecimal: 2 } } as Column, {});
+ const output = decimalFormatter(1, 1, input, { params: { minDecimal: 2 } } as Column, {}, {});
expect(output).toBe('99.10');
});
it('should display a number with dollar sign and use "minDecimalPlaces" (or the deprecated "decimalPlaces") params', () => {
const input = 12345678.1;
- const output1 = decimalFormatter(1, 1, input, { params: { minDecimalPlaces: 2 } } as Column, {});
- const output2 = decimalFormatter(1, 1, input, { params: { decimalPlaces: 2 } } as Column, {});
- const output3 = decimalFormatter(1, 1, input, { params: { decimalPlaces: 2, thousandSeparator: ',' } } as Column, {});
- const output4 = decimalFormatter(1, 1, input, { params: { decimalPlaces: 2, decimalSeparator: ',', thousandSeparator: ' ' } } as Column, {});
+ const output1 = decimalFormatter(1, 1, input, { params: { minDecimalPlaces: 2 } } as Column, {}, {});
+ const output2 = decimalFormatter(1, 1, input, { params: { decimalPlaces: 2 } } as Column, {}, {});
+ const output3 = decimalFormatter(1, 1, input, { params: { decimalPlaces: 2, thousandSeparator: ',' } } as Column, {}, {});
+ const output4 = decimalFormatter(1, 1, input, { params: { decimalPlaces: 2, decimalSeparator: ',', thousandSeparator: ' ' } } as Column, {}, {});
expect(output1).toBe('12345678.10');
expect(output2).toBe('12345678.10');
@@ -69,26 +69,26 @@ describe('the Decimal Formatter', () => {
it('should display a number with dollar sign and use "maxDecimal" params', () => {
const input = 88.156789;
- const output = decimalFormatter(1, 1, input, { params: { maxDecimal: 3 } } as Column, {});
+ const output = decimalFormatter(1, 1, input, { params: { maxDecimal: 3 } } as Column, {}, {});
expect(output).toBe(`88.157`);
});
it('should display a number with dollar sign and use "maxDecimalPlaces" params', () => {
const input = 88.156789;
- const output = decimalFormatter(1, 1, input, { params: { maxDecimalPlaces: 3 } } as Column, {});
+ const output = decimalFormatter(1, 1, input, { params: { maxDecimalPlaces: 3 } } as Column, {}, {});
expect(output).toBe(`88.157`);
expect(consoleSpy).toHaveBeenCalledWith('[Angular-Slickgrid] please consider using "maxDecimal" (instead of "maxDecimalPlaces").');
});
it('should display a negative number with parentheses when "displayNegativeNumberWithParentheses" is enabled in the "params"', () => {
const input = -2.4;
- const output = decimalFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true } } as Column, {});
+ const output = decimalFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true } } as Column, {}, {});
expect(output).toBe(`(2.40)`);
});
it('should display a negative number with parentheses when "displayNegativeNumberWithParentheses" is enabled and thousand separator in the "params"', () => {
const input = -12345678.4;
- const output = decimalFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true, thousandSeparator: ',' } } as Column, {});
+ const output = decimalFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true, thousandSeparator: ',' } } as Column, {}, {});
expect(output).toBe(`(12,345,678.40)`);
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/deleteIconFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/deleteIconFormatter.spec.ts
index f83d4b8e9..40411accb 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/deleteIconFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/deleteIconFormatter.spec.ts
@@ -4,13 +4,13 @@ import { deleteIconFormatter } from '../deleteIconFormatter';
describe('the Delete Icon Formatter', () => {
it('should always return the Font Awesome Trash icon even when False is provided', () => {
const value = false;
- const result = deleteIconFormatter(0, 0, value, {} as Column, {});
+ const result = deleteIconFormatter(0, 0, value, {} as Column, {}, {});
expect(result).toBe('');
});
it('should return the Font Awesome Trash icon when input is filled with any string', () => {
const value = 'anything';
- const result = deleteIconFormatter(0, 0, value, {} as Column, {});
+ const result = deleteIconFormatter(0, 0, value, {} as Column, {}, {});
expect(result).toBe('');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/dollarColoredBoldFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/dollarColoredBoldFormatter.spec.ts
index b472b1e2e..fd49bf26a 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/dollarColoredBoldFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/dollarColoredBoldFormatter.spec.ts
@@ -7,66 +7,66 @@ describe('the DollarColoredBold Formatter', () => {
};
it('should return an empty string when no value is provided', () => {
- const output = dollarColoredBoldFormatter(1, 1, '', {} as Column, {});
+ const output = dollarColoredBoldFormatter(1, 1, '', {} as Column, {}, {});
expect(output).toBe('');
});
it('should display original string when non-numeric value is provided', () => {
- const output = dollarColoredBoldFormatter(1, 1, 'hello', {} as Column, {});
+ const output = dollarColoredBoldFormatter(1, 1, 'hello', {} as Column, {}, {});
expect(output).toBe('hello');
});
it('should display a green number with dollar symbol formatter when number 0 is provided', () => {
const input = 0;
- const output = dollarColoredBoldFormatter(1, 1, input, {} as Column, {});
+ const output = dollarColoredBoldFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`$0.00`);
});
it('should display a red number with dollar symbol when value is a negative number', () => {
const input = -15;
- const output = dollarColoredBoldFormatter(1, 1, input, {} as Column, {});
+ const output = dollarColoredBoldFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`-$15.00`);
});
it('should display a red number with dollar symbol and thousand separator when value is a negative number', () => {
const input = -12345678;
- const output = dollarColoredBoldFormatter(1, 1, input, { params: { thousandSeparator: ',' } } as Column, {});
+ const output = dollarColoredBoldFormatter(1, 1, input, { params: { thousandSeparator: ',' } } as Column, {}, {});
expect(output).toBe(`-$12,345,678.00`);
});
it('should display a green number with dollar symbol when value greater or equal to 70 and is a type string', () => {
const input = '70';
- const output = dollarColoredBoldFormatter(1, 1, input, {} as Column, {});
+ const output = dollarColoredBoldFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`$70.00`);
});
it('should display a green number with dollar symbol with percentage of 100% when number is greater than 100 is provided', () => {
const input = 125;
- const output = dollarColoredBoldFormatter(1, 1, input, {} as Column, {});
+ const output = dollarColoredBoldFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`$125.00`);
});
it('should display a number with dollar sign and use minimum decimal set', () => {
const input = 99.1;
- const output = dollarColoredBoldFormatter(1, 1, input, { params: { minDecimal: 2 } } as Column, {});
+ const output = dollarColoredBoldFormatter(1, 1, input, { params: { minDecimal: 2 } } as Column, {}, {});
expect(output).toBe(`$99.10`);
});
it('should display a number with dollar sign and use maximum decimal set', () => {
const input = 88.156789;
- const output = dollarColoredBoldFormatter(1, 1, input, { params: { maxDecimal: 3 } } as Column, {});
+ const output = dollarColoredBoldFormatter(1, 1, input, { params: { maxDecimal: 3 } } as Column, {}, {});
expect(output).toBe(`$88.157`);
});
it('should display a negative number with parentheses when "displayNegativeNumberWithParentheses" is enabled in the "params"', () => {
const input = -2.4;
- const output = dollarColoredBoldFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true } } as Column, {});
+ const output = dollarColoredBoldFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true } } as Column, {}, {});
expect(output).toBe(`($2.40)`);
});
it('should display a negative number with parentheses when "displayNegativeNumberWithParentheses" is enabled and thousand separator in the "params"', () => {
const input = -12345678.4;
- const output = dollarColoredBoldFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true, thousandSeparator: ',' } } as Column, {});
+ const output = dollarColoredBoldFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true, thousandSeparator: ',' } } as Column, {}, {});
expect(output).toBe(`($12,345,678.40)`);
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/dollarColoredFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/dollarColoredFormatter.spec.ts
index 8d9d1c316..6b54e0659 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/dollarColoredFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/dollarColoredFormatter.spec.ts
@@ -7,66 +7,66 @@ describe('the DollarColored Formatter', () => {
};
it('should return an empty string when no value is provided', () => {
- const output = dollarColoredFormatter(1, 1, '', {} as Column, {});
+ const output = dollarColoredFormatter(1, 1, '', {} as Column, {}, {});
expect(output).toBe('');
});
it('should display original string when non-numeric value is provided', () => {
- const output = dollarColoredFormatter(1, 1, 'hello', {} as Column, {});
+ const output = dollarColoredFormatter(1, 1, 'hello', {} as Column, {}, {});
expect(output).toBe('hello');
});
it('should display a green number with dollar symbol formatter when number 0 is provided', () => {
const input = 0;
- const output = dollarColoredFormatter(1, 1, input, {} as Column, {});
+ const output = dollarColoredFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`$0.00`);
});
it('should display a red number with dollar symbol when value is a negative number', () => {
const input = -15;
- const output = dollarColoredFormatter(1, 1, input, {} as Column, {});
+ const output = dollarColoredFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`-$15.00`);
});
it('should display a red number with dollar symbol and thousand separator when value is a negative number', () => {
const input = -12345678;
- const output = dollarColoredFormatter(1, 1, input, { params: { thousandSeparator: ',' } } as Column, {});
+ const output = dollarColoredFormatter(1, 1, input, { params: { thousandSeparator: ',' } } as Column, {}, {});
expect(output).toBe(`-$12,345,678.00`);
});
it('should display a green number with dollar symbol when value greater or equal to 70 and is a type string', () => {
const input = '70';
- const output = dollarColoredFormatter(1, 1, input, {} as Column, {});
+ const output = dollarColoredFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`$70.00`);
});
it('should display a green number with dollar symbol with percentage of 100% when number is greater than 100 is provided', () => {
const input = 125;
- const output = dollarColoredFormatter(1, 1, input, {} as Column, {});
+ const output = dollarColoredFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`$125.00`);
});
it('should display a number with dollar sign and use minimum decimal set', () => {
const input = 99.1;
- const output = dollarColoredFormatter(1, 1, input, { params: { minDecimal: 2 } } as Column, {});
+ const output = dollarColoredFormatter(1, 1, input, { params: { minDecimal: 2 } } as Column, {}, {});
expect(output).toBe(`$99.10`);
});
it('should display a number with dollar sign and use maximum decimal set', () => {
const input = 88.156789;
- const output = dollarColoredFormatter(1, 1, input, { params: { maxDecimal: 3 } } as Column, {});
+ const output = dollarColoredFormatter(1, 1, input, { params: { maxDecimal: 3 } } as Column, {}, {});
expect(output).toBe(`$88.157`);
});
it('should display a negative number with parentheses when "displayNegativeNumberWithParentheses" is enabled in the "params"', () => {
const input = -2.4;
- const output = dollarColoredFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true } } as Column, {});
+ const output = dollarColoredFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true } } as Column, {}, {});
expect(output).toBe(`($2.40)`);
});
it('should display a negative number with parentheses when "displayNegativeNumberWithParentheses" is enabled and thousand separator in the "params"', () => {
const input = -12345678.4;
- const output = dollarColoredFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true, thousandSeparator: ',' } } as Column, {});
+ const output = dollarColoredFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true, thousandSeparator: ',' } } as Column, {}, {});
expect(output).toBe(`($12,345,678.40)`);
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/dollarFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/dollarFormatter.spec.ts
index 1606f2a9f..d34c37eca 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/dollarFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/dollarFormatter.spec.ts
@@ -7,66 +7,66 @@ describe('the Dollar Formatter', () => {
};
it('should display an empty string when no value is provided', () => {
- const output = dollarFormatter(1, 1, '', {} as Column, {});
+ const output = dollarFormatter(1, 1, '', {} as Column, {}, {});
expect(output).toBe('');
});
it('should display original string when non-numeric value is provided', () => {
- const output = dollarFormatter(1, 1, 'hello', {} as Column, {});
+ const output = dollarFormatter(1, 1, 'hello', {} as Column, {}, {});
expect(output).toBe('hello');
});
it('should display $0 when number 0 is provided', () => {
const input = 0;
- const output = dollarFormatter(1, 1, input, {} as Column, {});
+ const output = dollarFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`$0.00`);
});
it('should display a number with negative dollar sign when a negative number is provided', () => {
const input = -15;
- const output = dollarFormatter(1, 1, input, {} as Column, {});
+ const output = dollarFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`-$15.00`);
});
it('should display a number with negative dollar sign when a negative number and thousand separator is provided', () => {
const input = -12345678;
- const output = dollarFormatter(1, 1, input, { params: { thousandSeparator: ',' } } as Column, {});
+ const output = dollarFormatter(1, 1, input, { params: { thousandSeparator: ',' } } as Column, {}, {});
expect(output).toBe(`-$12,345,678.00`);
});
it('should display a number with dollar sign when a number is provided', () => {
const input = 99;
- const output = dollarFormatter(1, 1, input, {} as Column, {});
+ const output = dollarFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`$99.00`);
});
it('should display a number with dollar sign when a string number is provided', () => {
const input = '99';
- const output = dollarFormatter(1, 1, input, {} as Column, {});
+ const output = dollarFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`$99.00`);
});
it('should display a number with dollar sign and use minimum decimal set', () => {
const input = 99.1;
- const output = dollarFormatter(1, 1, input, { params: { minDecimal: 2 } } as Column, {});
+ const output = dollarFormatter(1, 1, input, { params: { minDecimal: 2 } } as Column, {}, {});
expect(output).toBe(`$99.10`);
});
it('should display a number with dollar sign and use maximum decimal set', () => {
const input = 88.156789;
- const output = dollarFormatter(1, 1, input, { params: { maxDecimal: 3 } } as Column, {});
+ const output = dollarFormatter(1, 1, input, { params: { maxDecimal: 3 } } as Column, {}, {});
expect(output).toBe(`$88.157`);
});
it('should display a negative number with parentheses when "displayNegativeNumberWithParentheses" is enabled in the "params"', () => {
const input = -2.4;
- const output = dollarFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true } } as Column, {});
+ const output = dollarFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true } } as Column, {}, {});
expect(output).toBe(`($2.40)`);
});
it('should display a negative number with parentheses when "displayNegativeNumberWithParentheses" is enabled and thousand separator in the "params"', () => {
const input = -12345678.4;
- const output = dollarFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true, thousandSeparator: ',' } } as Column, {});
+ const output = dollarFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true, thousandSeparator: ',' } } as Column, {}, {});
expect(output).toBe(`($12,345,678.40)`);
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/editIconFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/editIconFormatter.spec.ts
index 9b3b7b5cb..74883e9e1 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/editIconFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/editIconFormatter.spec.ts
@@ -4,13 +4,13 @@ import { editIconFormatter } from '../editIconFormatter';
describe('the Edit Icon Formatter', () => {
it('should always return the Font Awesome Pencil icon even when False is provided', () => {
const value = false;
- const result = editIconFormatter(0, 0, value, {} as Column, {});
+ const result = editIconFormatter(0, 0, value, {} as Column, {}, {});
expect(result).toBe('');
});
it('should return the Font Awesome Pencil icon when input is filled with any string', () => {
const value = 'anything';
- const result = editIconFormatter(0, 0, value, {} as Column, {});
+ const result = editIconFormatter(0, 0, value, {} as Column, {}, {});
expect(result).toBe('');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/hyperlinkFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/hyperlinkFormatter.spec.ts
index 60f91872f..43c705933 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/hyperlinkFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/hyperlinkFormatter.spec.ts
@@ -3,26 +3,26 @@ import { hyperlinkFormatter } from '../hyperlinkFormatter';
describe('the Hyperlink Formatter', () => {
it('should return empty string when value is not an hyperlink and is empty', () => {
- const result = hyperlinkFormatter(0, 0, '', {} as Column, {});
+ const result = hyperlinkFormatter(0, 0, '', {} as Column, {}, {});
expect(result).toBe('');
});
it('should return original value when value is not an hyperlink', () => {
- const result = hyperlinkFormatter(0, 0, 'anything', {} as Column, {});
+ const result = hyperlinkFormatter(0, 0, 'anything', {} as Column, {}, {});
expect(result).toBe('anything');
});
it('should return original value when URL passed through the generic params "hyperlinkUrl" is not a valid hyperlink', () => {
const hyperlinkUrl1 = '';
const inputValue = 'Company Name';
- const result1 = hyperlinkFormatter(0, 0, inputValue, { params: { hyperlinkUrl: hyperlinkUrl1 } } as Column, {});
+ const result1 = hyperlinkFormatter(0, 0, inputValue, { params: { hyperlinkUrl: hyperlinkUrl1 } } as Column, {}, {});
expect(result1).toBe(inputValue);
});
it('should not permit sanitize/remove any bad script code', () => {
const inputValue = 'http://company.com';
const sanitizedValue = 'http://company.com';
- const result = hyperlinkFormatter(0, 0, inputValue, {} as Column, {});
+ const result = hyperlinkFormatter(0, 0, inputValue, {} as Column, {}, {});
expect(result).toBe(`${sanitizedValue}`);
});
@@ -31,9 +31,9 @@ describe('the Hyperlink Formatter', () => {
const inputValue2 = 'https//something.com';
const inputValue3 = 'ftpp://something.com';
- const result1 = hyperlinkFormatter(0, 0, inputValue1, {} as Column, {});
- const result2 = hyperlinkFormatter(0, 0, inputValue2, {} as Column, {});
- const result3 = hyperlinkFormatter(0, 0, inputValue3, {} as Column, {});
+ const result1 = hyperlinkFormatter(0, 0, inputValue1, {} as Column, {}, {});
+ const result2 = hyperlinkFormatter(0, 0, inputValue2, {} as Column, {}, {});
+ const result3 = hyperlinkFormatter(0, 0, inputValue3, {} as Column, {}, {});
expect(result1).toBe(inputValue1);
expect(result2).toBe(inputValue2);
@@ -45,9 +45,9 @@ describe('the Hyperlink Formatter', () => {
const inputValue2 = 'https://something.com';
const inputValue3 = 'ftp://something.com';
- const result1 = hyperlinkFormatter(0, 0, inputValue1, {} as Column, {});
- const result2 = hyperlinkFormatter(0, 0, inputValue2, {} as Column, {});
- const result3 = hyperlinkFormatter(0, 0, inputValue3, {} as Column, {});
+ const result1 = hyperlinkFormatter(0, 0, inputValue1, {} as Column, {}, {});
+ const result2 = hyperlinkFormatter(0, 0, inputValue2, {} as Column, {}, {});
+ const result3 = hyperlinkFormatter(0, 0, inputValue3, {} as Column, {}, {});
expect(result1).toBe(`
${inputValue1}`);
@@ -61,9 +61,9 @@ describe('the Hyperlink Formatter', () => {
const inputValue3 = 'ftp://something.com';
const linkText = 'Company Website';
- const result1 = hyperlinkFormatter(0, 0, inputValue1, { params: { hyperlinkText: linkText } } as Column, {});
- const result2 = hyperlinkFormatter(0, 0, inputValue2, { params: { hyperlinkText: linkText } } as Column, {});
- const result3 = hyperlinkFormatter(0, 0, inputValue3, { params: { hyperlinkText: linkText } } as Column, {});
+ const result1 = hyperlinkFormatter(0, 0, inputValue1, { params: { hyperlinkText: linkText } } as Column, {}, {});
+ const result2 = hyperlinkFormatter(0, 0, inputValue2, { params: { hyperlinkText: linkText } } as Column, {}, {});
+ const result3 = hyperlinkFormatter(0, 0, inputValue3, { params: { hyperlinkText: linkText } } as Column, {}, {});
expect(result1).toBe(`
${linkText}`);
@@ -77,9 +77,9 @@ describe('the Hyperlink Formatter', () => {
const hyperlinkUrl3 = 'ftp://something.com';
const inputValue = 'Company Name';
- const result1 = hyperlinkFormatter(0, 0, inputValue, { params: { hyperlinkUrl: hyperlinkUrl1 } } as Column, {});
- const result2 = hyperlinkFormatter(0, 0, inputValue, { params: { hyperlinkUrl: hyperlinkUrl2 } } as Column, {});
- const result3 = hyperlinkFormatter(0, 0, inputValue, { params: { hyperlinkUrl: hyperlinkUrl3 } } as Column, {});
+ const result1 = hyperlinkFormatter(0, 0, inputValue, { params: { hyperlinkUrl: hyperlinkUrl1 } } as Column, {}, {});
+ const result2 = hyperlinkFormatter(0, 0, inputValue, { params: { hyperlinkUrl: hyperlinkUrl2 } } as Column, {}, {});
+ const result3 = hyperlinkFormatter(0, 0, inputValue, { params: { hyperlinkUrl: hyperlinkUrl3 } } as Column, {}, {});
expect(result1).toBe(`
${inputValue}`);
@@ -96,9 +96,9 @@ describe('the Hyperlink Formatter', () => {
const linkText3 = 'Company XYZ';
const inputValue = 'anything';
- const result1 = hyperlinkFormatter(0, 0, inputValue, { params: { hyperlinkUrl: hyperlinkUrl1, hyperlinkText: linkText1 } } as Column, {});
- const result2 = hyperlinkFormatter(0, 0, inputValue, { params: { hyperlinkUrl: hyperlinkUrl2, hyperlinkText: linkText2 } } as Column, {});
- const result3 = hyperlinkFormatter(0, 0, inputValue, { params: { hyperlinkUrl: hyperlinkUrl3, hyperlinkText: linkText3 } } as Column, {}); 3
+ const result1 = hyperlinkFormatter(0, 0, inputValue, { params: { hyperlinkUrl: hyperlinkUrl1, hyperlinkText: linkText1 } } as Column, {}, {});
+ const result2 = hyperlinkFormatter(0, 0, inputValue, { params: { hyperlinkUrl: hyperlinkUrl2, hyperlinkText: linkText2 } } as Column, {}, {});
+ const result3 = hyperlinkFormatter(0, 0, inputValue, { params: { hyperlinkUrl: hyperlinkUrl3, hyperlinkText: linkText3 } } as Column, {}, {}); 3
expect(result1).toBe(`
${linkText1}`);
expect(result2).toBe(`
${linkText2}`);
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/iconFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/iconFormatter.spec.ts
index daed00add..264cb4dbb 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/iconFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/iconFormatter.spec.ts
@@ -10,14 +10,14 @@ describe('the Icon Formatter', () => {
it('should always return a
with the icon class name provided in the "icon" property from "params"', () => {
const input = null;
const icon = 'fa fa-search';
- const result = iconFormatter(0, 0, input, { field: 'user', params: { icon } } as Column, {});
+ const result = iconFormatter(0, 0, input, { field: 'user', params: { icon } } as Column, {}, {});
expect(result).toBe(``);
});
it('should always return a with the icon class name provided in the "formatterIcon" property from "params"', () => {
const input = null;
const icon = 'fa fa-search';
- const result = iconFormatter(0, 0, input, { field: 'user', params: { formatterIcon: icon } } as Column, {});
+ const result = iconFormatter(0, 0, input, { field: 'user', params: { formatterIcon: icon } } as Column, {}, {});
expect(result).toBe(``);
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/infoIconFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/infoIconFormatter.spec.ts
index 34f43a21a..a042d65d5 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/infoIconFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/infoIconFormatter.spec.ts
@@ -4,13 +4,13 @@ import { infoIconFormatter } from '../infoIconFormatter';
describe('the Info Icon Formatter', () => {
it('should always return the Font Awesome Info icon even when False is provided', () => {
const value = false;
- const result = infoIconFormatter(0, 0, value, {} as Column, {});
+ const result = infoIconFormatter(0, 0, value, {} as Column, {}, {});
expect(result).toBe('');
});
it('should return the Font Awesome Info icon when input is filled with any string', () => {
const value = 'anything';
- const result = infoIconFormatter(0, 0, value, {} as Column, {});
+ const result = infoIconFormatter(0, 0, value, {} as Column, {}, {});
expect(result).toBe('');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/italicFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/italicFormatter.spec.ts
index 39cbd955a..969aeebdb 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/italicFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/italicFormatter.spec.ts
@@ -4,13 +4,13 @@ import { italicFormatter } from '../italicFormatter';
describe('the Italic Formatter', () => {
it('should return an empty string when no value is passed', () => {
const value = null;
- const result = italicFormatter(0, 0, value, {} as Column, {});
+ const result = italicFormatter(0, 0, value, {} as Column, {}, {});
expect(result).toBe('');
});
it('should return an italic html formatted string when value is filled', () => {
const value = 'john';
- const result = italicFormatter(0, 0, value, {} as Column, {});
+ const result = italicFormatter(0, 0, value, {} as Column, {}, {});
expect(result).toBe(`${value}`);
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/lowercaseFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/lowercaseFormatter.spec.ts
index 8d53cb4d4..5fbef2be8 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/lowercaseFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/lowercaseFormatter.spec.ts
@@ -3,22 +3,22 @@ import { lowercaseFormatter } from '../lowercaseFormatter';
describe('the Lowercase Formatter', () => {
it('should return an empty string when no value is passed', async () => {
- const output = lowercaseFormatter(1, 1, '', {} as Column, {});
+ const output = lowercaseFormatter(1, 1, '', {} as Column, {}, {});
expect(output).toBe('');
});
it('should return a string all in lowercase', () => {
- const output = lowercaseFormatter(1, 1, 'HeLlo', {} as Column, {});
+ const output = lowercaseFormatter(1, 1, 'HeLlo', {} as Column, {}, {});
expect(output).toBe('hello');
});
it('should return a number as a string', () => {
- const output = lowercaseFormatter(1, 1, 99, {} as Column, {});
+ const output = lowercaseFormatter(1, 1, 99, {} as Column, {}, {});
expect(output).toBe('99');
});
it('should return a boolean as a string all in lowercase', () => {
- const output = lowercaseFormatter(1, 1, false, {} as Column, {});
+ const output = lowercaseFormatter(1, 1, false, {} as Column, {}, {});
expect(output).toBe('false');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/maskFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/maskFormatter.spec.ts
index f473c101c..b674518c4 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/maskFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/maskFormatter.spec.ts
@@ -16,49 +16,49 @@ describe('the ArrayObjectToCsv Formatter', () => {
it('should return null when no value is provided', () => {
const input = null;
const params = { mask: '(000) 000-0000' };
- const result = maskFormatter(0, 0, input, { field: 'user', params } as Column, {});
+ const result = maskFormatter(0, 0, input, { field: 'user', params } as Column, {}, {});
expect(result).toBe(null);
});
it('should return formatted output according to mask when mask includes only numbers', () => {
const params = { mask: '(000) 000-0000' };
const inputValue = '123456789013';
- const result = maskFormatter(0, 0, inputValue, { field: 'user', params } as Column, {});
+ const result = maskFormatter(0, 0, inputValue, { field: 'user', params } as Column, {}, {});
expect(result).toBe('(123) 456-7890');
});
it('should return formatted output without extra digits that are not included in the mask', () => {
const params = { mask: '(000) 000-0000' };
const inputValue = '1234567890135455454';
- const result = maskFormatter(0, 0, inputValue, { field: 'user', params } as Column, {});
+ const result = maskFormatter(0, 0, inputValue, { field: 'user', params } as Column, {}, {});
expect(result).toBe('(123) 456-7890');
});
it('should return partially formatted output when input (digits only) length is shorter than mask', () => {
const params = { mask: '(000) 000-0000' };
const inputValue = '123456';
- const result = maskFormatter(0, 0, inputValue, { field: 'user', params } as Column, {});
+ const result = maskFormatter(0, 0, inputValue, { field: 'user', params } as Column, {}, {});
expect(result).toBe('(123) 456-');
});
it('should return formatted output (postal code) according to mask when mask includes both numbers and characters', () => {
const params = { mask: 'A0A 0A0' };
const inputValue = 'H0H0H0';
- const result = maskFormatter(0, 0, inputValue, { field: 'user', params } as Column, {});
+ const result = maskFormatter(0, 0, inputValue, { field: 'user', params } as Column, {}, {});
expect(result).toBe('H0H 0H0');
});
it('should return formatted output (postal code) without extra characters that are not included in the mask', () => {
const params = { mask: 'A0A 0A0' };
const inputValue = 'H0H0H0324343asdds';
- const result = maskFormatter(0, 0, inputValue, { field: 'user', params } as Column, {});
+ const result = maskFormatter(0, 0, inputValue, { field: 'user', params } as Column, {}, {});
expect(result).toBe('H0H 0H0');
});
it('should return partially formatted output when input (characters only) length is shorter than mask', () => {
const params = { mask: 'A0A 0A0' };
const inputValue = 'H0H0';
- const result = maskFormatter(0, 0, inputValue, { field: 'user', params } as Column, {});
+ const result = maskFormatter(0, 0, inputValue, { field: 'user', params } as Column, {}, {});
expect(result).toBe('H0H 0');
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/multipleFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/multipleFormatter.spec.ts
index e94a58915..ba0ee0cd9 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/multipleFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/multipleFormatter.spec.ts
@@ -7,14 +7,14 @@ describe('the Multiple Formatter', () => {
it('should return text output wrapped first as bold then wrapped as italic html formatted string', () => {
const value = 'john';
const params = { formatters: [boldFormatter, italicFormatter] };
- const result = multipleFormatter(0, 0, value, { params } as Column, {});
+ const result = multipleFormatter(0, 0, value, { params } as Column, {}, {});
expect(result).toBe(`${value}`);
});
it('should expect the first formatter to be the last wrapped format and not the other way around', () => {
const value = 'john';
const params = { formatters: [boldFormatter, italicFormatter] };
- const result = multipleFormatter(0, 0, value, { params } as Column, {});
+ const result = multipleFormatter(0, 0, value, { params } as Column, {}, {});
expect(result).toBe(`${value}`);
expect(result).not.toBe(`${value}`);
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/percentCompleteBarFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/percentCompleteBarFormatter.spec.ts
index 8d8ce2228..822c1c2e0 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/percentCompleteBarFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/percentCompleteBarFormatter.spec.ts
@@ -3,26 +3,26 @@ import { percentCompleteBarFormatter } from '../percentCompleteBarFormatter';
describe('the Percent Complete Formatter', () => {
it('should return an empty string when no value is provided', () => {
- const output = percentCompleteBarFormatter(1, 1, '', {} as Column, {});
+ const output = percentCompleteBarFormatter(1, 1, '', {} as Column, {}, {});
expect(output).toBe('');
});
it('should return empty string when non-numeric value is provided', () => {
- const output = percentCompleteBarFormatter(1, 1, 'hello', {} as Column, {});
+ const output = percentCompleteBarFormatter(1, 1, 'hello', {} as Column, {}, {});
expect(output).toBe('');
});
it('should display a red color bar formatter when number 0 is provided', () => {
const input = 0;
const color = 'red';
- const output = percentCompleteBarFormatter(1, 1, input, {} as Column, {});
+ const output = percentCompleteBarFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(``);
});
it('should display a red color bar when value is a negative number', () => {
const input = -15;
const color = 'red';
- const output = percentCompleteBarFormatter(1, 1, input, {} as Column, {});
+ const output = percentCompleteBarFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(``);
});
@@ -30,8 +30,8 @@ describe('the Percent Complete Formatter', () => {
const input1 = 30;
const input2 = 69;
const color = 'silver';
- const output1 = percentCompleteBarFormatter(1, 1, input1, {} as Column, {});
- const output2 = percentCompleteBarFormatter(1, 1, input2, {} as Column, {});
+ const output1 = percentCompleteBarFormatter(1, 1, input1, {} as Column, {}, {});
+ const output2 = percentCompleteBarFormatter(1, 1, input2, {} as Column, {}, {});
expect(output1).toBe(``);
expect(output2).toBe(``);
});
@@ -39,14 +39,14 @@ describe('the Percent Complete Formatter', () => {
it('should display a green color bar when value greater or equal to 70 and is a type string', () => {
const input = '70';
const color = 'green';
- const output = percentCompleteBarFormatter(1, 1, input, {} as Column, {});
+ const output = percentCompleteBarFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(``);
});
it('should display a green color bar with percentage of 100% when number is greater than 100 is provided', () => {
const input = 125;
const color = 'green';
- const output = percentCompleteBarFormatter(1, 1, input, {} as Column, {});
+ const output = percentCompleteBarFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(``);
});
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/percentCompleteFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/percentCompleteFormatter.spec.ts
index 0fd7fa516..b39ffb575 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/percentCompleteFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/percentCompleteFormatter.spec.ts
@@ -7,54 +7,54 @@ describe('the Percent Complete Formatter', () => {
};
it('should return an empty string when no value is provided', () => {
- const output = percentCompleteFormatter(1, 1, '', {} as Column, {});
+ const output = percentCompleteFormatter(1, 1, '', {} as Column, {}, {});
expect(output).toBe('');
});
it('should return original string when non-numeric value is provided', () => {
- const output = percentCompleteFormatter(1, 1, 'hello', {} as Column, {});
+ const output = percentCompleteFormatter(1, 1, 'hello', {} as Column, {}, {});
expect(output).toBe('hello');
});
it('should display a red color percentage when number 0 is provided', () => {
const input = 0;
- const output = percentCompleteFormatter(1, 1, input, {} as Column, {});
+ const output = percentCompleteFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`0%`);
});
it('should display a red color percentage when a negative number is provided', () => {
const input = -15;
- const output = percentCompleteFormatter(1, 1, input, {} as Column, {});
+ const output = percentCompleteFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`-15%`);
});
it('should display a green color percentage when a positive number greater or equal to 50 is provided', () => {
const input = 50;
- const output = percentCompleteFormatter(1, 1, input, {} as Column, {});
+ const output = percentCompleteFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`50%`);
});
it('should display a green color percentage when a positive number greater than 50 and is a type string is provided', () => {
const input = '99';
- const output = percentCompleteFormatter(1, 1, input, {} as Column, {});
+ const output = percentCompleteFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`99%`);
});
it('should display a green color percentage of 100% when number is greater than 100 is provided', () => {
const input = 125;
- const output = percentCompleteFormatter(1, 1, input, {} as Column, {});
+ const output = percentCompleteFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`100%`);
});
it('should display a negative percentage with parentheses when "displayNegativeNumberWithParentheses" is enabled in the "params"', () => {
const input = -2.4;
- const output = percentCompleteFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true } } as Column, {});
+ const output = percentCompleteFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true } } as Column, {}, {});
expect(output).toBe(`(2.4%)`);
});
it('should display a negative number with thousand separator and parentheses when "displayNegativeNumberWithParentheses" is enabled in the "params"', () => {
const input = -345678.024;
- const output = percentCompleteFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true, thousandSeparator: ',' } } as Column, {});
+ const output = percentCompleteFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true, thousandSeparator: ',' } } as Column, {}, {});
expect(output).toBe(`(345,678.024%)`);
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/percentFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/percentFormatter.spec.ts
index 3e33cc725..6ffa8928b 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/percentFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/percentFormatter.spec.ts
@@ -7,54 +7,54 @@ describe('the Percent Symbol Formatter', () => {
};
it('should display an empty string when no value is provided', () => {
- const output = percentFormatter(1, 1, '', {} as Column, {});
+ const output = percentFormatter(1, 1, '', {} as Column, {}, {});
expect(output).toBe('');
});
it('should display original string when non-numeric value is provided', () => {
- const output = percentFormatter(1, 1, 'hello', {} as Column, {});
+ const output = percentFormatter(1, 1, 'hello', {} as Column, {}, {});
expect(output).toBe('hello');
});
it('should display 0% when number 0 is provided', () => {
const input = 0;
- const output = percentFormatter(1, 1, input, {} as Column, {});
+ const output = percentFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`${input}%`);
});
it('should display -15% when the negative number -.15 is provided', () => {
const input = -.15;
- const output = percentFormatter(1, 1, input, {} as Column, {});
+ const output = percentFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe('-15%');
});
it('should display 99.5% when number 0.995 is provided', () => {
const input = 0.995;
- const output = percentFormatter(1, 1, input, {} as Column, {});
+ const output = percentFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe('99.5%');
});
it('should display 88% when the string "0.88" is provided', () => {
const input = '0.88';
- const output = percentFormatter(1, 1, input, {} as Column, {});
+ const output = percentFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe('88%');
});
it('should display thousand separated percentage when the thousand separator is provided', () => {
const input = '345678';
- const output = percentFormatter(1, 1, input, { params: { thousandSeparator: ',' } } as Column, {});
+ const output = percentFormatter(1, 1, input, { params: { thousandSeparator: ',' } } as Column, {}, {});
expect(output).toBe('34,567,800%');
});
it('should display a negative number with parentheses when "displayNegativeNumberWithParentheses" is enabled in the "params"', () => {
const input = -0.024;
- const output = percentFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true } } as Column, {});
+ const output = percentFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true } } as Column, {}, {});
expect(output).toBe(`(2.4%)`);
});
it('should display a negative number with thousand separator and parentheses when "displayNegativeNumberWithParentheses" is enabled in the "params"', () => {
const input = -345678.024;
- const output = percentFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true, thousandSeparator: ',' } } as Column, {});
+ const output = percentFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true, thousandSeparator: ',' } } as Column, {}, {});
expect(output).toBe(`(34,567,802.4%)`);
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/percentSymbolFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/percentSymbolFormatter.spec.ts
index 51e85b60c..f70f6cb59 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/percentSymbolFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/percentSymbolFormatter.spec.ts
@@ -7,66 +7,66 @@ describe('the Percent Symbol Formatter', () => {
};
it('should display an empty string when no value is provided', () => {
- const output = percentSymbolFormatter(1, 1, '', {} as Column, {});
+ const output = percentSymbolFormatter(1, 1, '', {} as Column, {}, {});
expect(output).toBe('');
});
it('should display original string when non-numeric value is provided', () => {
- const output = percentSymbolFormatter(1, 1, 'hello', {} as Column, {});
+ const output = percentSymbolFormatter(1, 1, 'hello', {} as Column, {}, {});
expect(output).toBe('hello');
});
it('should display 0% when number 0 is provided', () => {
const input = 0;
- const output = percentSymbolFormatter(1, 1, input, {} as Column, {});
+ const output = percentSymbolFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`0%`);
});
it('should display a number with negative percentage sign when a negative number is provided', () => {
const input = -15;
- const output = percentSymbolFormatter(1, 1, input, {} as Column, {});
+ const output = percentSymbolFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`-15%`);
});
it('should display a number with thousand separator and negative percentage sign when a negative number is provided', () => {
const input = -15;
- const output = percentSymbolFormatter(1, 1, input, {} as Column, {});
+ const output = percentSymbolFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`-15%`);
});
it('should display a number with percentage sign when a number is provided', () => {
const input = 99;
- const output = percentSymbolFormatter(1, 1, input, {} as Column, {});
+ const output = percentSymbolFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`99%`);
});
it('should display a number with thousand separator and percentage sign when a number is provided', () => {
const input = 2345678;
- const output = percentSymbolFormatter(1, 1, input, { params: { thousandSeparator: ',' } } as Column, {});
+ const output = percentSymbolFormatter(1, 1, input, { params: { thousandSeparator: ',' } } as Column, {}, {});
expect(output).toBe(`2,345,678%`);
});
it('should display a number with percentage sign when a string number is provided', () => {
const input = '99';
- const output = percentSymbolFormatter(1, 1, input, {} as Column, {});
+ const output = percentSymbolFormatter(1, 1, input, {} as Column, {}, {});
expect(output).toBe(`99%`);
});
it('should display a number with thousand separator and percentage sign when a string number is provided', () => {
const input = '2345678';
- const output = percentSymbolFormatter(1, 1, input, { params: { thousandSeparator: ',' } } as Column, {});
+ const output = percentSymbolFormatter(1, 1, input, { params: { thousandSeparator: ',' } } as Column, {}, {});
expect(output).toBe(`2,345,678%`);
});
it('should display a negative number with parentheses when "displayNegativeNumberWithParentheses" is enabled in the "params"', () => {
const input = -2.4;
- const output = percentSymbolFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true } } as Column, {});
+ const output = percentSymbolFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true } } as Column, {}, {});
expect(output).toBe(`(2.4%)`);
});
it('should display a negative number with thousand separator and parentheses when "displayNegativeNumberWithParentheses" is enabled in the "params"', () => {
const input = -2345678.4;
- const output = percentSymbolFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true, thousandSeparator: ',' } } as Column, {});
+ const output = percentSymbolFormatter(1, 1, input, { params: { displayNegativeNumberWithParentheses: true, thousandSeparator: ',' } } as Column, {}, {});
expect(output).toBe(`(2,345,678.4%)`);
});
diff --git a/src/app/modules/angular-slickgrid/formatters/__tests__/progressBarFormatter.spec.ts b/src/app/modules/angular-slickgrid/formatters/__tests__/progressBarFormatter.spec.ts
index 7feea6cfb..e4e8042f6 100644
--- a/src/app/modules/angular-slickgrid/formatters/__tests__/progressBarFormatter.spec.ts
+++ b/src/app/modules/angular-slickgrid/formatters/__tests__/progressBarFormatter.spec.ts
@@ -3,12 +3,12 @@ import { progressBarFormatter } from '../progressBarFormatter';
describe('the Progress Bar Formatter', () => {
it('should return an empty string when no value is provided', () => {
- const output = progressBarFormatter(1, 1, '', {} as Column, {});
+ const output = progressBarFormatter(1, 1, '', {} as Column, {}, {});
expect(output).toBe('');
});
it('should return empty string when non-numeric value is provided', () => {
- const output = progressBarFormatter(1, 1, 'hello', {} as Column, {});
+ const output = progressBarFormatter(1, 1, 'hello', {} as Column, {}, {});
expect(output).toBe('');
});
@@ -19,7 +19,7 @@ describe('the Progress Bar Formatter', () => {
${inputValue}%
`;
- const output = progressBarFormatter(1, 1, inputValue, {} as Column, {});
+ const output = progressBarFormatter(1, 1, inputValue, {} as Column, {}, {});
expect(output).toBe(template.replace(/\s{2,}/g, ' ').trim());
});
@@ -30,7 +30,7 @@ describe('the Progress Bar Formatter', () => {