[dataset-single][m]: Remove test for components since we are using portaljs
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
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"))
|
||||
});
|
||||
});
|
||||
@@ -1,27 +0,0 @@
|
||||
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'))
|
||||
});
|
||||
});
|
||||
@@ -1,39 +0,0 @@
|
||||
import React from 'react'
|
||||
import { render } from '@testing-library/react';
|
||||
import path from 'path'
|
||||
import Home from '../../pages/index';
|
||||
import { getDataset } from "../../lib/dataset"
|
||||
import { addView } from '../../lib/utils'
|
||||
|
||||
|
||||
let plotlyDatasetWithView
|
||||
|
||||
beforeAll(async () => {
|
||||
const plotlyDatasetsDirectory = path.join(process.cwd(), 'fixtures', 'datasetsPlotlyView')
|
||||
|
||||
const plotlyDataset = await getDataset(plotlyDatasetsDirectory)
|
||||
plotlyDatasetWithView = addView(plotlyDataset)
|
||||
});
|
||||
|
||||
|
||||
/** @test {Home Component} */
|
||||
describe('Home Component', () => {
|
||||
it('should render without crashing', async () => {
|
||||
const dataset = plotlyDatasetWithView.props.dataset
|
||||
const specs = plotlyDatasetWithView.props.specs
|
||||
const { findAllByText } = render(<Home dataset={dataset} specs={specs} />)
|
||||
expect(await findAllByText('README'))
|
||||
|
||||
});
|
||||
it('Sections are found in home page', async () => {
|
||||
const dataset = plotlyDatasetWithView.props.dataset
|
||||
const specs = plotlyDatasetWithView.props.specs
|
||||
const { findByTestId, findAllByText } = render(<Home dataset={dataset} specs={specs} />)
|
||||
expect(await findAllByText('Key info'))
|
||||
expect(await findAllByText('Data Files'))
|
||||
expect(await findAllByText('Graph'))
|
||||
expect(await findAllByText('Data Preview'))
|
||||
expect(await findByTestId('datasetTitle'))
|
||||
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user