Skip to content

Commit

Permalink
chore(app): Cleanup unused duplicates of DeleteFile / DeleteDir compo…
Browse files Browse the repository at this point in the history
…nents
  • Loading branch information
nellh committed Feb 16, 2023
1 parent c632860 commit 524eaca
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 160 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react'
import { render, fireEvent, screen } from '@testing-library/react'
import { MockedProvider } from '@apollo/client/testing'
import DeleteDataset, { DELETE_DATASET } from '../delete.jsx'
import DeleteDir, { DELETE_FILES } from '../delete-dir.jsx'

const datasetId = 'ds999999'
const path = 'sub-99'
Expand Down Expand Up @@ -43,35 +42,3 @@ describe('DeleteDataset mutation', () => {
expect(asFragment()).toMatchSnapshot()
})
})

describe('DeleteDir mutation', () => {
it('renders with common props', () => {
const { asFragment } = render(
<MockedProvider mocks={[deleteDirMock]} addTypename={false}>
<DeleteDir
datasetId="ds002"
fileTree={{
files: [],
directories: [],
path: '',
}}
/>
</MockedProvider>,
)
expect(asFragment()).toMatchSnapshot()
})
it('fires the correct mutation', async () => {
render(
<MockedProvider mocks={[deleteDirMock]} addTypename={false}>
<DeleteDir {...{ datasetId, path }} />
</MockedProvider>,
)

// click "Delete" button
await fireEvent.click(screen.getByRole('button'))
// confirm delete
await fireEvent.click(screen.getByLabelText('confirm'))

expect(deleteDirMock.newData).toHaveBeenCalled()
})
})

This file was deleted.

0 comments on commit 524eaca

Please sign in to comment.