Fix jest tests by upgrading jest and other related packages.

This commit is contained in:
Laurent Nguyen
2024-06-27 16:52:26 +02:00
parent cc1f89ff4b
commit b4090425f4
99 changed files with 12015 additions and 11393 deletions

View File

@@ -36,21 +36,21 @@ describe("The Heatmap Control", () => {
});
it("should call _getChartSettings when drawHeatmap is invoked", () => {
const _getChartSettings = spyOn<any>(heatmap, "_getChartSettings");
const _getChartSettings = jest.spyOn(heatmap, "_getChartSettings");
heatmap.drawHeatmap();
expect(_getChartSettings.calls.any()).toBe(true);
expect(_getChartSettings).toHaveBeenCalled();
});
it("should call _getLayoutSettings when drawHeatmap is invoked", () => {
const _getLayoutSettings = spyOn<any>(heatmap, "_getLayoutSettings");
const _getLayoutSettings = jest.spyOn(heatmap, "_getLayoutSettings");
heatmap.drawHeatmap();
expect(_getLayoutSettings.calls.any()).toBe(true);
expect(_getLayoutSettings).toHaveBeenCalled();
});
it("should call _getChartDisplaySettings when drawHeatmap is invoked", () => {
const _getChartDisplaySettings = spyOn<any>(heatmap, "_getChartDisplaySettings");
const _getChartDisplaySettings = jest.spyOn(heatmap, "_getChartDisplaySettings");
heatmap.drawHeatmap();
expect(_getChartDisplaySettings.calls.any()).toBe(true);
expect(_getChartDisplaySettings).toHaveBeenCalled();
});
it("drawHeatmap should render a Heatmap inside the div element", () => {

View File

@@ -96,7 +96,8 @@ export class Heatmap {
return output;
}
private _getChartSettings(): ChartSettings[] {
// public for testing purposes
public _getChartSettings(): ChartSettings[] {
return [
{
z: this._chartData.dataPoints,
@@ -131,7 +132,8 @@ export class Heatmap {
];
}
private _getLayoutSettings(): LayoutSettings {
// public for testing purposes
public _getLayoutSettings(): LayoutSettings {
return {
margin: {
l: 40,
@@ -177,7 +179,8 @@ export class Heatmap {
};
}
private _getChartDisplaySettings(): DisplaySettings {
// public for testing purposes
public _getChartDisplaySettings(): DisplaySettings {
return {
/* heatmap can be fully responsive however the min-height needed in that case is greater than the iframe portal height, hence explicit width + height have been set in _getLayoutSettings
responsive: true,*/