Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Lens][Visualize][Canvas] Adds titles to the heatmap axis #123992

Merged
merged 7 commits into from
Feb 1, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add unit test
stratoula committed Jan 28, 2022
commit 739a94de2baee12017cc9ff3c8b13b80f48f5f78
Original file line number Diff line number Diff line change
@@ -59,16 +59,18 @@ const args: HeatmapArguments = {
highlightInHover: false,
xAccessor: 'col-1-2',
valueAccessor: 'col-0-1',
yAccessor: 'col-2-3',
};
const data: Datatable = {
type: 'datatable',
rows: [
{ 'col-0-1': 0, 'col-1-2': 'a' },
{ 'col-0-1': 148, 'col-1-2': 'b' },
{ 'col-0-1': 0, 'col-1-2': 'a', 'col-2-3': 'd' },
{ 'col-0-1': 148, 'col-1-2': 'b', 'col-2-3': 'c' },
],
columns: [
{ id: 'col-0-1', name: 'Count', meta: { type: 'number' } },
{ id: 'col-1-2', name: 'Dest', meta: { type: 'string' } },
{ id: 'col-2-3', name: 'Test', meta: { type: 'string' } },
],
};

@@ -163,6 +165,12 @@ describe('HeatmapComponent', function () {
});
});

it('renders the axis titles', () => {
const component = shallowWithIntl(<HeatmapComponent {...wrapperProps} />);
expect(component.find(Heatmap).prop('xAxisTitle')).toEqual('Dest');
expect(component.find(Heatmap).prop('yAxisTitle')).toEqual('Test');
});

it('hides the legend if the legend isVisible args is false', async () => {
const newProps = {
...wrapperProps,