[packages/portal][l]: Moved portal folder to root dir
This commit is contained in:
26
tests/components/Chart.test.js
Normal file
26
tests/components/Chart.test.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import React from 'react'
|
||||
import {render } from '@testing-library/react';
|
||||
import path from 'path'
|
||||
import Chart from '../../components/Chart';
|
||||
import { getDataset } from "../../lib/dataset"
|
||||
import { addView } from '../../lib/utils'
|
||||
|
||||
|
||||
let dataset
|
||||
let datasetWithView
|
||||
|
||||
beforeAll(async () => {
|
||||
const datasetsDirectory = path.join(process.cwd(), 'fixtures', 'datasetsPlotlyView')
|
||||
dataset = await getDataset(datasetsDirectory)
|
||||
datasetWithView = addView(dataset)
|
||||
});
|
||||
|
||||
|
||||
/** @test {Chart Component} */
|
||||
describe('Chart Component', () => {
|
||||
it('should render without crashing', async () => {
|
||||
const spec = JSON.parse(datasetWithView.props.specs)[0]
|
||||
const { findByTestId } = render(<Chart spec={spec} />)
|
||||
expect(await findByTestId("plotlyChart"))
|
||||
});
|
||||
});
|
||||
27
tests/components/Table.test.js
Normal file
27
tests/components/Table.test.js
Normal file
@@ -0,0 +1,27 @@
|
||||
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'))
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user