Rufus Pollock 5fcdfa2f76 [portal,#59][l]: new portal package that (right now) presents a single dataset.
* What we have is a nextjs app for displaying a single dataset (+ tests, +fixtures etc)
* Also included are relevant generic components (e.g. a Chart and Table view) and some utilities for loading (Frictionless) datasets
* Not include (but to come) is the command line app
2021-03-07 22:33:40 +01:00

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'))
});
});