1
0
mirror of https://github.com/oceanprotocol/commons.git synced 2023-03-15 18:03:00 +01:00

more test fixes

This commit is contained in:
Matthias Kretschmann 2019-09-05 12:34:11 +02:00
parent 5002effbfe
commit 6db965b79a
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 5 additions and 5 deletions

View File

@ -72,13 +72,13 @@ describe('Files', () => {
const { container, getByText } = renderComponent() const { container, getByText } = renderComponent()
// open // open
fireEvent.click(getByText('+ From public URL')) fireEvent.click(getByText('+ From URL'))
await waitForElement(() => getByText('- Cancel')) await waitForElement(() => getByText('- Cancel'))
expect(container.querySelector('.itemForm')).toBeInTheDocument() expect(container.querySelector('.itemForm')).toBeInTheDocument()
// close // close
fireEvent.click(getByText('- Cancel')) fireEvent.click(getByText('- Cancel'))
await waitForElement(() => getByText('+ From public URL')) await waitForElement(() => getByText('+ From URL'))
expect(container.querySelector('.itemForm')).not.toBeInTheDocument() expect(container.querySelector('.itemForm')).not.toBeInTheDocument()
}) })
@ -109,7 +109,7 @@ describe('Files', () => {
it('item can be added', async () => { it('item can be added', async () => {
const { getByText, getByPlaceholderText } = renderComponent() const { getByText, getByPlaceholderText } = renderComponent()
fireEvent.click(getByText('+ From public URL')) fireEvent.click(getByText('+ From URL'))
await waitForElement(() => getByText('- Cancel')) await waitForElement(() => getByText('- Cancel'))
fireEvent.change(getByPlaceholderText('Hello'), { fireEvent.change(getByPlaceholderText('Hello'), {
target: { value: 'https://hello.com' } target: { value: 'https://hello.com' }

View File

@ -173,7 +173,7 @@ export default class Files extends PureComponent<FilesProps, FilesStates> {
)} )}
<Button link onClick={this.toggleForm}> <Button link onClick={this.toggleForm}>
{isFormShown ? '- Cancel' : '+ From public URL'} {isFormShown ? '- Cancel' : '+ From URL'}
</Button> </Button>
<Button link onClick={this.toggleIpfsForm}> <Button link onClick={this.toggleIpfsForm}>

View File

@ -14,7 +14,7 @@ context('Publish', () => {
cy.get('input#name').type('Commons Integration Test') cy.get('input#name').type('Commons Integration Test')
// Open Add a file form // Open Add a file form
cy.get('button') cy.get('button')
.contains('+ Add a file') .contains('+ From URL')
.click() .click()
// Fill url of file // Fill url of file
cy.get('input#url').type( cy.get('input#url').type(