Skip to content

Commit

Permalink
change mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
ryu-sato committed Nov 23, 2024
1 parent 1a719a3 commit e866697
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 19 deletions.
11 changes: 6 additions & 5 deletions src/mock/MockTable50Lines.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';

import ReactDOM from 'react-dom/client';
import rehypeParse from 'rehype-parse';
import { unified } from 'unified';

import { wrapDataTable } from '../DataTable';
import { adaptDataTable } from '../DataTable';

const tableHTML = (
const tableHTML = `
<table className="table table-bordered">
<thead>
<tr>
Expand Down Expand Up @@ -266,8 +267,8 @@ const tableHTML = (
</tr>
</tbody>
</table>
);
const DataTables = wrapDataTable(() => tableHTML);
`;
const DataTables = (await (await unified().use(rehypeParse, { fragment: true }).use(adaptDataTable).process(tableHTML)).result) as any;

ReactDOM.createRoot(document.getElementById('MockTable50Lines') as HTMLElement).render(
<React.StrictMode>
Expand Down
11 changes: 6 additions & 5 deletions src/mock/MockTable5Lines.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';

import rehypeParse from 'rehype-parse';
import { unified } from 'unified';
import ReactDOM from 'react-dom/client';

import { wrapDataTable } from '../DataTable';
import { adaptDataTable } from '../DataTable';

const tableHTML = (
const tableHTML = `
<table className="table table-bordered">
<thead>
<tr>
Expand Down Expand Up @@ -41,8 +42,8 @@ const tableHTML = (
</tr>
</tbody>
</table>
);
const DataTables = wrapDataTable(() => tableHTML);
`;
const DataTables = (await (await unified().use(rehypeParse, { fragment: true }).use(adaptDataTable).process(tableHTML)).result) as any;

ReactDOM.createRoot(document.getElementById('MockTable5Lines') as HTMLElement).render(
<React.StrictMode>
Expand Down
11 changes: 6 additions & 5 deletions src/mock/MockTableForCalcMethod.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import React from 'react';

import ReactDOM from 'react-dom/client';
import rehypeParse from 'rehype-parse';
import { unified } from 'unified';

import { wrapDataTable } from '../DataTable';
import { adaptDataTable } from '../DataTable';

const tableHTML = (
const tableHTML = `
<table className="table table-bordered">
<thead>
<tr>
Expand Down Expand Up @@ -83,8 +84,8 @@ const tableHTML = (
</tr>
</tbody>
</table>
);
const DataTables = wrapDataTable(() => tableHTML);
`;
const DataTables = (await (await unified().use(rehypeParse, { fragment: true }).use(adaptDataTable).process(tableHTML)).result) as any;

ReactDOM.createRoot(document.getElementById('MockTableForCaclMethod') as HTMLElement).render(
<React.StrictMode>
Expand Down
10 changes: 6 additions & 4 deletions src/mock/MockTableIssue9.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import React from 'react';

import ReactDOM from 'react-dom/client';
import rehypeParse from 'rehype-parse';
import { unified } from 'unified';

import { wrapDataTable } from '../DataTable';
import { adaptDataTable } from '../DataTable';

const tableHTML = (
const tableHTML = `
<table className="table table-bordered">
<thead>
<tr>
Expand Down Expand Up @@ -35,8 +37,8 @@ const tableHTML = (
</tr>
</tbody>
</table>
);
const DataTables = wrapDataTable(() => tableHTML);
`;
const DataTables = (await (await unified().use(rehypeParse, { fragment: true }).use(adaptDataTable).process(tableHTML)).result) as any;

ReactDOM.createRoot(document.getElementById('MockTableIssue9') as HTMLElement).render(
<React.StrictMode>
Expand Down

0 comments on commit e866697

Please sign in to comment.