Skip to content

Commit

Permalink
just for tables
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamwasp committed Oct 15, 2024
1 parent e30e521 commit 836a6ab
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/gamut/src/Markdown/__tests__/Markdown.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,6 @@ const table = `
const renderView = setupRtl(Markdown);

describe('<Markdown />', () => {
beforeEach(() => {
// We are mimicking unconventional behavior in the markdown parser, so these errors are expected.
jest.spyOn(console, 'error').mockImplementation(jest.fn());
});
it('renders standard Markdown', () => {
renderView({ text: basicMarkdown });
screen.getByRole('heading', { level: 1 });
Expand All @@ -94,13 +90,15 @@ describe('<Markdown />', () => {
});

it('Renders custom tables in markdown', () => {
jest.spyOn(console, 'error').mockImplementation(jest.fn());
renderView({ text: table });
expect(document.querySelectorAll('div.tableWrapper table').length).toEqual(
1
);
});

it('Skips rendering custom tables in markdown when skipProcessing.table is true', () => {
jest.spyOn(console, 'error').mockImplementation(jest.fn());
renderView({
skipDefaultOverrides: { table: true },
text: table,
Expand Down

0 comments on commit 836a6ab

Please sign in to comment.