Skip to content

Commit

Permalink
test: update tests and snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardo committed Mar 4, 2024
1 parent dc7005f commit b060ddb
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 114 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test('renders just the button when menu closed', () => {
expect(getByRole('button')).toBeTruthy()
expect(queryByText('View as Map')).toBeNull()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeNull()
expect(queryByText('View as Pivot table')).toBeNull()
expect(queryByTestId('divider')).toBeNull()
expect(queryByText('Open in Data Visualizer app')).toBeNull()
expect(queryByText('Show details and interpretations')).toBeNull()
Expand Down Expand Up @@ -113,7 +113,7 @@ test('renders popover menu for BAR chart', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeTruthy()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeTruthy()
expect(queryByText('View as Pivot table')).toBeTruthy()
expect(queryByTestId('divider')).toBeTruthy()
expect(queryByText('Open in Data Visualizer app')).toBeTruthy()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand All @@ -140,7 +140,7 @@ test('renders popover menu for SINGLE_VALUE chart', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeNull()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeNull()
expect(queryByText('View as Pivot table')).toBeNull()
expect(queryByTestId('divider')).toBeNull()
expect(queryByText('Open in Data Visualizer app')).toBeTruthy()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand All @@ -167,7 +167,7 @@ test('renders popover menu for YEAR_OVER_YEAR_LINE chart', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeNull()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeNull()
expect(queryByText('View as Pivot table')).toBeNull()
expect(queryByTestId('divider')).toBeNull()
expect(queryByText('Open in Data Visualizer app')).toBeTruthy()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand All @@ -194,7 +194,7 @@ test('renders popover menu for GAUGE chart', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeNull()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeNull()
expect(queryByText('View as Pivot table')).toBeNull()
expect(queryByTestId('divider')).toBeNull()
expect(queryByText('Open in Data Visualizer app')).toBeTruthy()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand All @@ -221,7 +221,7 @@ test('renders popover menu for PIE chart', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeNull()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeNull()
expect(queryByText('View as Pivot table')).toBeNull()
expect(queryByTestId('divider')).toBeNull()
expect(queryByText('Open in Data Visualizer app')).toBeTruthy()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand Down Expand Up @@ -252,7 +252,7 @@ test('renders popover menu for PIVOT_TABLE', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeTruthy()
expect(queryByText('View as Chart')).toBeTruthy()
expect(queryByText('View as Table')).toBeNull()
expect(queryByText('View as Pivot table')).toBeNull()
expect(queryByTestId('divider')).toBeTruthy()
expect(queryByText('Open in Data Visualizer app')).toBeTruthy()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand Down Expand Up @@ -281,7 +281,7 @@ test('renders popover menu for MAP', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeNull()
expect(queryByText('View as Chart')).toBeTruthy()
expect(queryByText('View as Table')).toBeTruthy()
expect(queryByText('View as Pivot table')).toBeTruthy()
expect(queryByTestId('divider')).toBeTruthy()
expect(queryByText('Open in Maps app')).toBeTruthy()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand Down Expand Up @@ -379,7 +379,7 @@ test('renders only View in App when item load failed', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeNull()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeNull()
expect(queryByText('View as Pivot table')).toBeNull()
expect(queryByTestId('divider')).toBeNull()
expect(queryByText('Open in Maps app')).toBeTruthy()
expect(queryByText('Show details and interpretations')).toBeNull()
Expand Down Expand Up @@ -467,7 +467,7 @@ test('renders correct options for BAR in small screen', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeTruthy()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeTruthy()
expect(queryByText('View as Pivot table')).toBeTruthy()
expect(queryByTestId('divider')).toBeTruthy()
expect(queryByText('Open in Data Visualizer app')).toBeNull()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand Down Expand Up @@ -498,7 +498,7 @@ test('renders correct options for PIE in small screen', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeNull()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeNull()
expect(queryByText('View as Pivot table')).toBeNull()
expect(queryByTestId('divider')).toBeNull()
expect(queryByText('Open in Data Visualizer app')).toBeNull()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ test('renders just the button when menu closed', () => {
expect(getByRole('button')).toBeTruthy()
expect(queryByText('View as Map')).toBeNull()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeNull()
expect(queryByText('View as Pivot table')).toBeNull()
expect(queryByTestId('divider')).toBeNull()
expect(queryByText('Open in Data Visualizer app')).toBeNull()
expect(queryByText('Show details and interpretations')).toBeNull()
Expand Down Expand Up @@ -113,7 +113,7 @@ test('renders popover menu for BAR chart', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeTruthy()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeTruthy()
expect(queryByText('View as Pivot table')).toBeTruthy()
expect(queryByTestId('divider')).toBeTruthy()
expect(queryByText('Open in Data Visualizer app')).toBeTruthy()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand All @@ -140,7 +140,7 @@ test('renders popover menu for SINGLE_VALUE chart', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeNull()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeNull()
expect(queryByText('View as Pivot table')).toBeNull()
expect(queryByTestId('divider')).toBeNull()
expect(queryByText('Open in Data Visualizer app')).toBeTruthy()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand All @@ -167,7 +167,7 @@ test('renders popover menu for YEAR_OVER_YEAR_LINE chart', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeNull()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeNull()
expect(queryByText('View as Pivot table')).toBeNull()
expect(queryByTestId('divider')).toBeNull()
expect(queryByText('Open in Data Visualizer app')).toBeTruthy()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand All @@ -194,7 +194,7 @@ test('renders popover menu for GAUGE chart', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeNull()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeNull()
expect(queryByText('View as Pivot table')).toBeNull()
expect(queryByTestId('divider')).toBeNull()
expect(queryByText('Open in Data Visualizer app')).toBeTruthy()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand All @@ -221,7 +221,7 @@ test('renders popover menu for PIE chart', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeNull()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeNull()
expect(queryByText('View as Pivot table')).toBeNull()
expect(queryByTestId('divider')).toBeNull()
expect(queryByText('Open in Data Visualizer app')).toBeTruthy()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand Down Expand Up @@ -252,7 +252,7 @@ test('renders popover menu for PIVOT_TABLE', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeTruthy()
expect(queryByText('View as Chart')).toBeTruthy()
expect(queryByText('View as Table')).toBeNull()
expect(queryByText('View as Pivot table')).toBeNull()
expect(queryByTestId('divider')).toBeTruthy()
expect(queryByText('Open in Data Visualizer app')).toBeTruthy()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand Down Expand Up @@ -281,7 +281,7 @@ test('renders popover menu for MAP', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeNull()
expect(queryByText('View as Chart')).toBeTruthy()
expect(queryByText('View as Table')).toBeTruthy()
expect(queryByText('View as Pivot table')).toBeTruthy()
expect(queryByTestId('divider')).toBeTruthy()
expect(queryByText('Open in Maps app')).toBeTruthy()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand Down Expand Up @@ -379,7 +379,7 @@ test('renders only View in App when item load failed', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeNull()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeNull()
expect(queryByText('View as Pivot table')).toBeNull()
expect(queryByTestId('divider')).toBeNull()
expect(queryByText('Open in Maps app')).toBeTruthy()
expect(queryByText('Show details and interpretations')).toBeNull()
Expand Down Expand Up @@ -467,7 +467,7 @@ test('renders correct options for BAR in small screen', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeTruthy()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeTruthy()
expect(queryByText('View as Pivot table')).toBeTruthy()
expect(queryByTestId('divider')).toBeTruthy()
expect(queryByText('Open in Data Visualizer app')).toBeNull()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand Down Expand Up @@ -498,7 +498,7 @@ test('renders correct options for PIE in small screen', async () => {
await waitFor(() => {
expect(queryByText('View as Map')).toBeNull()
expect(queryByText('View as Chart')).toBeNull()
expect(queryByText('View as Table')).toBeNull()
expect(queryByText('View as Pivot table')).toBeNull()
expect(queryByTestId('divider')).toBeNull()
expect(queryByText('Open in Data Visualizer app')).toBeNull()
expect(queryByText('Show details and interpretations')).toBeTruthy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ test('renders menu for active type MAP and type CHART', async () => {
const props = Object.assign({}, defaultProps, {
type: CHART,
activeType: MAP,
visualization: {
type: 'COLUMN',
},
})

const { container } = render(<ViewAsMenuItems {...props} />)
Expand All @@ -49,6 +52,9 @@ test('renders disabled menu items when offline', () => {
const props = Object.assign({}, defaultProps, {
type: CHART,
activeType: MAP,
visualization: {
type: 'COLUMN',
},
})

const { container } = render(<ViewAsMenuItems {...props} />)
Expand Down Expand Up @@ -105,7 +111,7 @@ test('renders menu for active type REPORT_TABLE and type CHART', async () => {
const props = Object.assign({}, defaultProps, {
type: CHART,
activeType: REPORT_TABLE,
visualization: {},
visualization: { type: 'COLUMN' },
})

const { container } = render(<ViewAsMenuItems {...props} />)
Expand All @@ -118,7 +124,7 @@ test('renders menu for active type CHART and type REPORT_TABLE', async () => {
const props = Object.assign({}, defaultProps, {
type: REPORT_TABLE,
activeType: CHART,
visualization: {},
visualization: { type: 'PIVOT_TABLE' },
})

const { container } = render(<ViewAsMenuItems {...props} />)
Expand Down
Loading

0 comments on commit b060ddb

Please sign in to comment.