Skip to content

Commit

Permalink
test: catch up with timeAxisTickCount
Browse files Browse the repository at this point in the history
  • Loading branch information
monfera committed Oct 22, 2021
1 parent ccbd7c0 commit 917ac6c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const axisSpec: AxisSpec = {
position: Position.Left,
style,
tickFormat: (value: any) => `${value}`,
timeAxisLayerCount: 0,
};
axesSpecs.push(axisSpec);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,7 @@ describe('Chart state pointer interactions', () => {
showOverlappingLabels: false,
showOverlappingTicks: false,
style,
timeAxisLayerCount: 0,
};
bottomAxis = {
chartType: ChartType.XYAxis,
Expand All @@ -767,6 +768,7 @@ describe('Chart state pointer interactions', () => {
showOverlappingLabels: false,
showOverlappingTicks: false,
style,
timeAxisLayerCount: 0,
};
currentSettingSpec = getSettingsSpecSelector(store.getState());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1311,6 +1311,7 @@ describe('Axis computational utils', () => {
showOverlappingTicks: false,
style,
tickFormat: formatter,
timeAxisLayerCount: 0,
};
const xDomainTime = MockXDomain.fromScaleType(ScaleType.Time, {
isBandScale: false,
Expand Down Expand Up @@ -1357,6 +1358,7 @@ describe('Axis computational utils', () => {
style,
tickFormat: (d, options) =>
DateTime.fromMillis(d, { setZone: true, zone: options?.timeZone ?? 'utc+1' }).toFormat('HH:mm'),
timeAxisLayerCount: 3,
};
const xDomainTime = MockXDomain.fromScaleType(ScaleType.Time, {
isBandScale: false,
Expand Down Expand Up @@ -1410,6 +1412,7 @@ describe('Axis computational utils', () => {
showOverlappingTicks: false,
style,
tickFormat: formatter,
timeAxisLayerCount: 3,
};
const xDomainTime = MockXDomain.fromScaleType(ScaleType.Time, {
isBandScale: false,
Expand Down Expand Up @@ -1462,6 +1465,7 @@ describe('Axis computational utils', () => {
showOverlappingTicks: false,
style,
tickFormat: formatter,
timeAxisLayerCount: 3,
};
const xDomainTime = MockXDomain.fromScaleType(ScaleType.Time, {
isBandScale: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ describe('Computed chart dimensions', () => {
showOverlappingLabels: false,
position: Position.Left,
tickFormat: (value: any) => `${value}`,
timeAxisLayerCount: 0,
};
const legend: LegendStyle = {
verticalWidth: 10,
Expand Down
1 change: 1 addition & 0 deletions packages/charts/src/mocks/specs/specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ export class MockGlobalSpec {
showOverlappingTicks: false,
showOverlappingLabels: false,
position: Position.Left,
timeAxisLayerCount: 0,
};

private static readonly settingsBaseNoMargings: SettingsSpec = {
Expand Down
2 changes: 1 addition & 1 deletion storybook/stories/area/21_with_time_timeslip.story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export const Example = () => {
tickFormat={tooltipDateFormatter}
labelFormat={topAxisLabelFormat}
title="time (1-minute measurements)"
timeAxisLayerCount={number('layerCount', 0, { range: true, min: 0, max: 3, step: 1 })}
timeAxisLayerCount={number('layerCount', 3, { range: true, min: 0, max: 3, step: 1 })}
/>
<Axis
id="left"
Expand Down

0 comments on commit 917ac6c

Please sign in to comment.