feat: add warning metadata to tables and metrics (#13606)

This commit is contained in:
Erik Ritter
2021-03-17 21:27:34 -07:00
committed by GitHub
parent db57f90a34
commit 64785c20bd
13 changed files with 529 additions and 415 deletions

View File

@@ -72,6 +72,7 @@ describe('datasourcepanel', () => {
expect(screen.getByText('birth_names')).toBeTruthy();
expect(screen.getByText('Columns')).toBeTruthy();
expect(screen.getByText('Metrics')).toBeTruthy();
expect(screen.queryByTestId('warning')).not.toBeInTheDocument();
});
it('should render search results', () => {
@@ -103,4 +104,24 @@ describe('datasourcepanel', () => {
expect(c[0].value).toBe('metric_end_certified');
}, 201);
});
it('should render a warning', () => {
const deprecatedDatasource = {
...datasource,
extra: JSON.stringify({ warning_markdown: 'This is a warning.' }),
};
render(
setup({
...props,
datasource: deprecatedDatasource,
controls: {
datasource: {
...props.controls.datasource,
datasource: deprecatedDatasource,
},
},
}),
);
expect(screen.getByTestId('alert-solid')).toBeTruthy();
});
});