diff --git a/packages/synchro-charts/cypress/integration/charts/bar-chart/draggable-annotations.spec.ts b/packages/synchro-charts/cypress/integration/charts/bar-chart/draggable-annotations.spec.ts index 16d27fc3c..5e0bf396f 100644 --- a/packages/synchro-charts/cypress/integration/charts/bar-chart/draggable-annotations.spec.ts +++ b/packages/synchro-charts/cypress/integration/charts/bar-chart/draggable-annotations.spec.ts @@ -70,10 +70,10 @@ it('draggable annotation rescales axis in positive direction', () => { cy.get('g.axis.y-axis > g.tick').should('have.length', 17); cy.get('g.axis.y-axis > g.tick > text') .eq(16) - .should('have.text', '8.0k'); + .should('have.text', '8k'); cy.get('g.axis.y-axis > g.tick > text') .eq(0) - .should('have.text', '0.0'); + .should('have.text', '0'); }); it('draggable annotation rescales axis in negative direction', () => { @@ -90,10 +90,10 @@ it('draggable annotation rescales axis in negative direction', () => { cy.get('g.axis.y-axis > g.tick').should('have.length', 9); cy.get('g.axis.y-axis > g.tick > text') .eq(8) - .should('have.text', '3.0k'); + .should('have.text', '3k'); cy.get('g.axis.y-axis > g.tick > text') .eq(0) - .should('have.text', '−5.0k'); + .should('have.text', '−5k'); }); it('non-Editable annotation is not draggable', () => { diff --git a/packages/synchro-charts/cypress/integration/charts/line-chart/draggable-annotations.spec.ts b/packages/synchro-charts/cypress/integration/charts/line-chart/draggable-annotations.spec.ts index e6c5de3c4..6a8e6f976 100644 --- a/packages/synchro-charts/cypress/integration/charts/line-chart/draggable-annotations.spec.ts +++ b/packages/synchro-charts/cypress/integration/charts/line-chart/draggable-annotations.spec.ts @@ -220,10 +220,10 @@ it('draggable annotation rescales axis in positive direction', () => { cy.get('g.axis.y-axis > g.tick').should('have.length', 17); cy.get('g.axis.y-axis > g.tick > text') .eq(16) - .should('have.text', '9.0k'); + .should('have.text', '9k'); cy.get('g.axis.y-axis > g.tick > text') .eq(0) - .should('have.text', '1.0k'); + .should('have.text', '1k'); }); it('draggable annotation rescales axis in negative direction', () => { @@ -240,10 +240,10 @@ it('draggable annotation rescales axis in negative direction', () => { cy.get('g.axis.y-axis > g.tick').should('have.length', 10); cy.get('g.axis.y-axis > g.tick > text') .eq(9) - .should('have.text', '5.0k'); + .should('have.text', '5k'); cy.get('g.axis.y-axis > g.tick > text') .eq(0) - .should('have.text', '−4.0k'); + .should('have.text', '−4k'); }); it('non-Editable annotation is not draggable', () => { diff --git a/packages/synchro-charts/cypress/integration/charts/scatter-chart/draggable-annotations.spec.ts b/packages/synchro-charts/cypress/integration/charts/scatter-chart/draggable-annotations.spec.ts index 2909438ee..a54d03608 100644 --- a/packages/synchro-charts/cypress/integration/charts/scatter-chart/draggable-annotations.spec.ts +++ b/packages/synchro-charts/cypress/integration/charts/scatter-chart/draggable-annotations.spec.ts @@ -104,10 +104,10 @@ it('draggable annotation rescales axis in positive direction', () => { cy.get('g.axis.y-axis > g.tick').should('have.length', 17); cy.get('g.axis.y-axis > g.tick > text') .eq(16) - .should('have.text', '9.0k'); + .should('have.text', '9k'); cy.get('g.axis.y-axis > g.tick > text') .eq(0) - .should('have.text', '1.0k'); + .should('have.text', '1k'); }); it('draggable annotation rescales axis in negative direction', () => { @@ -124,10 +124,10 @@ it('draggable annotation rescales axis in negative direction', () => { cy.get('g.axis.y-axis > g.tick').should('have.length', 10); cy.get('g.axis.y-axis > g.tick > text') .eq(9) - .should('have.text', '5.0k'); + .should('have.text', '5k'); cy.get('g.axis.y-axis > g.tick > text') .eq(0) - .should('have.text', '−4.0k'); + .should('have.text', '−4k'); }); it('non-Editable annotation is not draggable', () => { diff --git a/packages/synchro-charts/cypress/snapshots/charts/bar-chart/sc-webgl-bar-chart.spec.ts/handles buffer increasing in size after initialization -- renders bars when switch to a viewport way outside the points and back to the original viewport.snap.png b/packages/synchro-charts/cypress/snapshots/charts/bar-chart/sc-webgl-bar-chart.spec.ts/handles buffer increasing in size after initialization -- renders bars when switch to a viewport way outside the points and back to the original viewport.snap.png index 5c177fed7..126a16e2f 100644 Binary files a/packages/synchro-charts/cypress/snapshots/charts/bar-chart/sc-webgl-bar-chart.spec.ts/handles buffer increasing in size after initialization -- renders bars when switch to a viewport way outside the points and back to the original viewport.snap.png and b/packages/synchro-charts/cypress/snapshots/charts/bar-chart/sc-webgl-bar-chart.spec.ts/handles buffer increasing in size after initialization -- renders bars when switch to a viewport way outside the points and back to the original viewport.snap.png differ diff --git a/packages/synchro-charts/cypress/snapshots/charts/line-chart/draggable-annotations.spec.ts/drags properly without snapping back even if outdated annotation is passed in.snap.png b/packages/synchro-charts/cypress/snapshots/charts/line-chart/draggable-annotations.spec.ts/drags properly without snapping back even if outdated annotation is passed in.snap.png index 7c561021c..b05e5db03 100644 Binary files a/packages/synchro-charts/cypress/snapshots/charts/line-chart/draggable-annotations.spec.ts/drags properly without snapping back even if outdated annotation is passed in.snap.png and b/packages/synchro-charts/cypress/snapshots/charts/line-chart/draggable-annotations.spec.ts/drags properly without snapping back even if outdated annotation is passed in.snap.png differ diff --git a/packages/synchro-charts/cypress/snapshots/charts/line-chart/threshold-coloration.spec.ts/creates a threshold band coloration with one less than threshold and one greater than threshold.snap.png b/packages/synchro-charts/cypress/snapshots/charts/line-chart/threshold-coloration.spec.ts/creates a threshold band coloration with one less than threshold and one greater than threshold.snap.png index cf39f3416..cac859e5d 100644 Binary files a/packages/synchro-charts/cypress/snapshots/charts/line-chart/threshold-coloration.spec.ts/creates a threshold band coloration with one less than threshold and one greater than threshold.snap.png and b/packages/synchro-charts/cypress/snapshots/charts/line-chart/threshold-coloration.spec.ts/creates a threshold band coloration with one less than threshold and one greater than threshold.snap.png differ diff --git a/packages/synchro-charts/cypress/support/commands.js b/packages/synchro-charts/cypress/support/commands.js index b03891066..ca0417b19 100644 --- a/packages/synchro-charts/cypress/support/commands.js +++ b/packages/synchro-charts/cypress/support/commands.js @@ -30,7 +30,7 @@ import { addChartCommands } from './chartCommands'; addChartCommands(); addMatchImageSnapshotCommand({ - failureThresholdType: 'pixel', - failureThreshold: 2, + failureThresholdType: 'percent', + failureThreshold: 0.01, customDiffConfig: { threshold: 0.2 }, }); diff --git a/packages/synchro-charts/src/components/charts/sc-webgl-base-chart/renderAxis.ts b/packages/synchro-charts/src/components/charts/sc-webgl-base-chart/renderAxis.ts index b205856db..f20178f8b 100644 --- a/packages/synchro-charts/src/components/charts/sc-webgl-base-chart/renderAxis.ts +++ b/packages/synchro-charts/src/components/charts/sc-webgl-base-chart/renderAxis.ts @@ -72,7 +72,7 @@ const yAxisConstructor = (size: SizeConfig, viewport: ViewPort) => { return axisLeft(yScale) .ticks(yTickCount) - .tickFormat(format('.2s')) + .tickFormat(format('.4~s')) .tickSize(-size.width) .tickPadding(TICK_PADDING); }; diff --git a/packages/synchro-charts/src/components/charts/sc-webgl-base-chart/sc-webgl-axis.spec.tsx b/packages/synchro-charts/src/components/charts/sc-webgl-base-chart/sc-webgl-axis.spec.tsx index 4ca82cb78..58a8c2a22 100644 --- a/packages/synchro-charts/src/components/charts/sc-webgl-base-chart/sc-webgl-axis.spec.tsx +++ b/packages/synchro-charts/src/components/charts/sc-webgl-base-chart/sc-webgl-axis.spec.tsx @@ -126,9 +126,9 @@ describe('initial render', () => { it('has expected y axis value labels', async () => { const { axis } = await axisSpecPage(); - expect(axis.innerHTML).toContain('3.0k'); + expect(axis.innerHTML).toContain('3k'); + expect(axis.innerHTML).toContain('3.05k'); expect(axis.innerHTML).toContain('3.1k'); - expect(axis.innerHTML).not.toContain('3.00k'); }); it('renders the y-axis label', async () => { @@ -246,9 +246,9 @@ describe('updated correctly', () => { expect(axis.innerHTML).not.toContain('3.10k'); // Does contain new y labels - expect(axis.innerHTML).toContain('4.0k'); + expect(axis.innerHTML).toContain('4k'); expect(axis.innerHTML).toContain('4.5k'); - expect(axis.innerHTML).toContain('5.0k'); + expect(axis.innerHTML).toContain('5k'); }); it('updates the y-axis label', async () => {