Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,7 @@ describe('IgxButtonGroup', () => {

buttongroup.deselectButton(-1);
buttongroup.deselectButton(3000);
}
catch (ex) {
} catch (ex) {
error = ex.message;
}

Expand All @@ -377,8 +376,7 @@ describe('IgxButtonGroup', () => {

if (i < groupChildren.length - 1) {
expect(button.nativeElement.disabled).toBe(false);
}
else {
} else {
expect(button.nativeElement.disabled).toBe(true);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2138,8 +2138,7 @@ describe("IgxCalendar - ", () => {
try {
calendar.locale = "frrr";
fixture.detectChanges();
}
catch (err) {
} catch (err) {
errorThrown = err;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -690,8 +690,7 @@ describe('Carousel', () => {
const indicator = HelperTestFunctions.getIndicators(fixture)[index] as HTMLElement;
if (index === 1) {
expect(indicator.innerText).toEqual('1: Active');
}
else {
} else {
expect(indicator.innerText).toEqual(index.toString());
}
}
Expand Down Expand Up @@ -1082,8 +1081,7 @@ class HelperTestFunctions {
const carouselNative = fixture.nativeElement;
if (position === CarouselIndicatorsOrientation.end) {
return carouselNative.querySelector(HelperTestFunctions.INDICATORS_END_CLASS);
}
else {
} else {
return carouselNative.querySelector(HelperTestFunctions.INDICATORS_START_CLASS);
}
}
Expand Down Expand Up @@ -1127,8 +1125,7 @@ class HelperTestFunctions {
let event;
if (dir === 'horizontal') {
event = deltaOffset < 0 ? 'panleft' : 'panright';
}
else {
} else {
event = deltaOffset < 0 ? 'panup' : 'pandown';
}
const panOptions = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,7 @@ describe('igxCombo', () => {
let errorMessage = '';
try {
combo.data = null;
}
catch (ex) {
} catch (ex) {
errorMessage = ex.message;
}
expect(errorMessage).toBe('');
Expand All @@ -325,8 +324,7 @@ describe('igxCombo', () => {
let errorMessage = '';
try {
combo.data = undefined;
}
catch (ex) {
} catch (ex) {
errorMessage = ex.message;
}
expect(errorMessage).toBe('');
Expand Down Expand Up @@ -1104,8 +1102,7 @@ describe('igxCombo', () => {
await wait(30);
checkGroupedItemsClass();
});
}
else {
} else {
;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1523,8 +1523,7 @@ describe('IgxDatePicker', () => {
parseIsoDate.mockImplementation((val: string) => {
if (val === undefined || mockDate1) {
return mockDate2;
}
else {
} else {
return init(val);
}
});
Expand Down Expand Up @@ -1559,8 +1558,7 @@ describe('IgxDatePicker', () => {
const mockCheck = (value: Date): value is Date => {
if (value === mockMinValue || value === mockMaxValue) {
return true;
}
else {
} else {
return defaultCheck(value);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,7 @@ describe('IgxForOf directive -', () => {
try {
fix.componentInstance.itemSize = '100px';
fix.detectChanges();
}
catch (ex) {
} catch (ex) {
errorMessage = ex.message;
}
expect(errorMessage).toBe('');
Expand Down Expand Up @@ -1150,8 +1149,7 @@ describe('IgxForOf directive -', () => {
}
if (i % 2 === 0) {
expect(allItems[i].classes['even']).toBe(true);
}
else {
} else {
expect(allItems[i].classes['odd']).toBe(true);
}
}
Expand Down Expand Up @@ -1310,8 +1308,7 @@ class DataGenerator {
if (instance) {
instance.cols = cols;
instance.data = dummyData;
}
else {
} else {
return { data: dummyData, cols };
}
}
Expand All @@ -1320,8 +1317,7 @@ class DataGenerator {
if (this.data300x50000.length !== 0) {
instance.cols = this.cols300;
instance.data = this.data300x50000;
}
else {
} else {
const result = this.generateData(300, 50000);
this.data300x50000 = result.data;
this.cols300 = result.cols;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1191,16 +1191,13 @@ export const verifyTooltipPosition = (tooltipNativeElement: HTMLElement, actualT
if (placement.startsWith('top')) {
actualOffset = target.top - tooltip.bottom;
directionCheckPassed = Math.abs(actualOffset - offset) <= directionTolerance;
}
else if (placement.startsWith('bottom')) {
} else if (placement.startsWith('bottom')) {
actualOffset = tooltip.top - target.bottom;
directionCheckPassed = Math.abs(actualOffset - offset) <= directionTolerance;
}
else if (placement.startsWith('left')) {
} else if (placement.startsWith('left')) {
actualOffset = target.left - tooltip.right;
directionCheckPassed = Math.abs(actualOffset - offset) <= directionTolerance;
}
else if (placement.startsWith('right')) {
} else if (placement.startsWith('right')) {
actualOffset = tooltip.left - target.right;
directionCheckPassed = Math.abs(actualOffset - offset) <= directionTolerance;
}
Expand All @@ -1209,29 +1206,25 @@ export const verifyTooltipPosition = (tooltipNativeElement: HTMLElement, actualT
// --- alignment check ---
if (placement.startsWith('top') || placement.startsWith('bottom')) {
alignmentCheckPassed = horizontalAlignmentMatches(tooltip, target, placement);
}
else {
} else {
alignmentCheckPassed = verticalAlignmentMatches(tooltip, target, placement);
}

const result = directionCheckPassed && alignmentCheckPassed;

if (shouldAlign) {
expect(result).toBeTruthy(`Tooltip misaligned for "${placement}": actual offset=${actualOffset}, wanted offset=${offset}, accurate placement=${directionCheckPassed}, accurate alignment=${alignmentCheckPassed}`);
}
else {
} else {
expect(result).toBeFalsy(`Tooltip was unexpectedly aligned`);
}
};

function horizontalAlignmentMatches(tooltip: DOMRect, target: DOMRect, placement: Placement): boolean {
if (placement.endsWith('start')) {
return Math.abs(tooltip.left - target.left) <= alignmentTolerance;
}
else if (placement.endsWith('end')) {
} else if (placement.endsWith('end')) {
return Math.abs(tooltip.right - target.right) <= alignmentTolerance;
}
else {
} else {
const tooltipMid = tooltip.left + tooltip.width / 2;
const targetMid = target.left + target.width / 2;
return Math.abs(tooltipMid - targetMid) <= alignmentTolerance;
Expand All @@ -1241,11 +1234,9 @@ function horizontalAlignmentMatches(tooltip: DOMRect, target: DOMRect, placement
function verticalAlignmentMatches(tooltip: DOMRect, target: DOMRect, placement: Placement): boolean {
if (placement.endsWith('start')) {
return Math.abs(tooltip.top - target.top) <= alignmentTolerance;
}
else if (placement.endsWith('end')) {
} else if (placement.endsWith('end')) {
return Math.abs(tooltip.bottom - target.bottom) <= alignmentTolerance;
}
else {
} else {
const tooltipMid = tooltip.top + tooltip.height / 2;
const targetMid = target.top + target.height / 2;
return Math.abs(tooltipMid - targetMid) <= alignmentTolerance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,8 +391,7 @@ describe('IgxAutocomplete', () => {
const hasFocusedClass = itemElement.classList.contains(CSS_CLASS_DROP_DOWN_ITEM_FOCUSED);
if (isFocused) {
expect(hasFocusedClass).toBeTruthy();
}
else {
} else {
expect(hasFocusedClass).toBeFalsy();
}
expect(dropDown.items[itemIndex].focused).toEqual(isFocused);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,7 @@ describe('igxExpansionPanel', () => {
}
if (collapsed) {
expect(panelContainer.lastElementChild.nodeName).toEqual('IGX-EXPANSION-PANEL-HEADER');
}
else {
} else {
const panelBody = panelContainer.getElementsByTagName(CSS_CLASS_PANEL_BODY)[0];
expect(panelBody).toBeDefined();
const list = panelBody.getElementsByTagName(CSS_CLASS_LIST)[0];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,7 @@ describe('Excel Exporter', () => {
exporter.columnExporting.subscribe((value: IColumnExportingEventArgs) => {
if (value.columnIndex === 0) {
value.columnIndex = 4;
}
else if (value.columnIndex === 2) {
} else if (value.columnIndex === 2) {
value.columnIndex = -1;
}
});
Expand Down Expand Up @@ -1146,8 +1145,7 @@ describe('Excel Exporter', () => {
try {
exporter.export(treeGrid, options);
await wait();
}
catch (ex) {
} catch (ex) {
error = ex.message;
}
expect(error).toMatch('Can create an outline of up to eight levels!');
Expand All @@ -1160,8 +1158,7 @@ describe('Excel Exporter', () => {
try {
exporter.export(treeGrid, options);
await wait();
}
catch (ex) {
} catch (ex) {
error = ex.message;
}
expect(error).toEqual('');
Expand All @@ -1174,8 +1171,7 @@ describe('Excel Exporter', () => {
try {
exporter.export(treeGrid, options);
await wait();
}
catch (ex) {
} catch (ex) {
error = ex.message;
}
expect(error).toMatch('Can create an outline of up to eight levels!');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,13 @@ describe('Excel Exporter', () => {
it('should throw an exception when setting negative width and height.', () => {
try {
options.columnWidth = -1;
}
catch (ex) {
} catch (ex) {
expect((ex as Error).message).toBe('Invalid value for column width!');
}

try {
options.rowHeight = -1;
}
catch (ex) {
} catch (ex) {
expect((ex as Error).message).toBe('Invalid value for row height!');
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ export class ZipFiles {
`xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac" ` +
`xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac">${sheetData}` +
`<pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3"/>${tablePart}</worksheet>`;
}
else {
} else {
const dimensionsPart = isHGrid ? '' : '<dimension ref="A1"/>';

return `<?xml version="1.0" encoding="UTF-8"?>
Expand Down
Loading