The current app at root of repo is for single frictionless dataset. Should be in its own example so we have space going forward for multiple example and for root to have core portal.js code. * Also refactor its README (moved from root) to reflect it is just an example * Move design content from the root README.md into DESIGN.md * Stub a new root README.md based largely on examples/catalog/README.md
27 lines
875 B
JavaScript
27 lines
875 B
JavaScript
import React from 'react'
|
|
import { render } from '@testing-library/react';
|
|
import path from 'path'
|
|
import Table from '../../components/Table';
|
|
import { getDataset } from "../../lib/dataset"
|
|
|
|
|
|
let dataset
|
|
|
|
beforeAll(async () => {
|
|
const datasetsDirectory = path.join(process.cwd(), 'fixtures', 'datasetsPlotlyView')
|
|
dataset = await getDataset(datasetsDirectory)
|
|
});
|
|
|
|
|
|
/** @test {Table Component} */
|
|
describe('Table Component', () => {
|
|
it('should render without crashing', async () => {
|
|
const resource = dataset.resources[0]
|
|
render(<Table data={resource.sample} schema={resource.schema} />)
|
|
});
|
|
it('tableGrid div is found', async () => {
|
|
const resource = dataset.resources[0]
|
|
const { findByTestId } = render(<Table data={resource.sample} schema={resource.schema} />)
|
|
expect(await findByTestId('tableGrid'))
|
|
});
|
|
}); |