Revert "fix: disable text reports for now (#16257)" (#16296)

This reverts commit ee9a384758.
This commit is contained in:
Beto Dealmeida 2021-08-17 14:21:15 -07:00 committed by GitHub
parent 4119bb9c1e
commit 3c0aefb61a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 2 deletions

View File

@ -126,7 +126,12 @@ type ReportActionType =
};
const DEFAULT_NOTIFICATION_FORMAT = 'TEXT';
const TEXT_BASED_VISUALIZATION_TYPES: string[] = [];
const TEXT_BASED_VISUALIZATION_TYPES = [
'pivot_table',
'pivot_table_v2',
'table',
'paired_ttest',
];
const reportReducer = (
state: Partial<ReportObject> | null,

View File

@ -260,6 +260,22 @@ describe('AlertReportModal', () => {
expect(wrapper.find(Radio)).toHaveLength(2);
});
it('renders text option for text-based charts', async () => {
const props = {
...mockedProps,
alert: mockData,
};
const textWrapper = await mountAndWait(props);
const chartOption = textWrapper.find('input[value="chart"]');
act(() => {
chartOption.props().onChange({ target: { value: 'chart' } });
});
await waitForComponentToPaint(textWrapper);
expect(textWrapper.find('input[value="TEXT"]')).toExist();
});
it('renders input element for working timeout', () => {
expect(wrapper.find('input[name="working_timeout"]')).toExist();
});

View File

@ -52,7 +52,12 @@ import {
const SELECT_PAGE_SIZE = 2000; // temporary fix for paginated query
const TIMEOUT_MIN = 1;
const TEXT_BASED_VISUALIZATION_TYPES: string[] = [];
const TEXT_BASED_VISUALIZATION_TYPES = [
'pivot_table',
'pivot_table_v2',
'table',
'paired_ttest',
];
type SelectValue = {
value: string;