Merge pull request #12237 from influxdata/tests/scrapers-creation

test(scrapers): add test for creating scrapers
pull/12247/head
Palakp41 2019-02-27 16:23:48 -08:00 committed by GitHub
commit 9c33541275
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 50 additions and 8 deletions

View File

@ -0,0 +1,40 @@
describe('Scrapers', () => {
beforeEach(() => {
cy.flush()
cy.signin().then(({body}) => {
const {
org: {id},
} = body
cy.fixture('routes').then(({orgs}) => {
cy.visit(`${orgs}/${id}/scrapers_tab`)
})
})
})
describe('from the org view', () => {
it('can create a scraper', () => {
const newScraper = 'Scraper'
const newURL = 'http://google.com'
cy.getByTestID('table-row').should('have.length', 0)
cy.contains('Create').click()
cy.getByTestID('overlay--container').within(() => {
cy.getByInputName('name')
.clear()
.type(newScraper)
cy.getByInputName('url')
.clear()
.type(newURL)
cy.get('.button')
.contains('Finish')
.click()
})
cy.getByTestID('table-row')
.should('have.length', 1)
.and('contain', newScraper)
})
})
})

View File

@ -42,6 +42,7 @@ export class ScraperTarget extends PureComponent<Props> {
<Input
type={InputType.Text}
value={name}
name="name"
onChange={this.handleChangeName}
titleText="Name"
size={ComponentSize.Medium}
@ -65,6 +66,7 @@ export class ScraperTarget extends PureComponent<Props> {
<Input
type={InputType.Text}
value={url}
name="url"
onChange={this.handleChangeURL}
titleText="Target URL"
size={ComponentSize.Medium}

View File

@ -15,7 +15,7 @@ exports[`ScraperTarget rendering renders correctly with bucket 1`] = `
autoFocus={true}
autocomplete="off"
disabledTitleText="This input is disabled"
name=""
name="name"
onChange={[Function]}
placeholder=""
size="md"
@ -49,7 +49,7 @@ exports[`ScraperTarget rendering renders correctly with bucket 1`] = `
autoFocus={false}
autocomplete="off"
disabledTitleText="This input is disabled"
name=""
name="url"
onChange={[Function]}
placeholder=""
size="md"
@ -81,7 +81,7 @@ exports[`ScraperTarget rendering renders correctly with name 1`] = `
autoFocus={true}
autocomplete="off"
disabledTitleText="This input is disabled"
name=""
name="name"
onChange={[Function]}
placeholder=""
size="md"
@ -115,7 +115,7 @@ exports[`ScraperTarget rendering renders correctly with name 1`] = `
autoFocus={false}
autocomplete="off"
disabledTitleText="This input is disabled"
name=""
name="url"
onChange={[Function]}
placeholder=""
size="md"
@ -147,7 +147,7 @@ exports[`ScraperTarget rendering renders correctly with no bucket, url, name 1`]
autoFocus={true}
autocomplete="off"
disabledTitleText="This input is disabled"
name=""
name="name"
onChange={[Function]}
placeholder=""
size="md"
@ -181,7 +181,7 @@ exports[`ScraperTarget rendering renders correctly with no bucket, url, name 1`]
autoFocus={false}
autocomplete="off"
disabledTitleText="This input is disabled"
name=""
name="url"
onChange={[Function]}
placeholder=""
size="md"
@ -213,7 +213,7 @@ exports[`ScraperTarget rendering renders correctly with url 1`] = `
autoFocus={true}
autocomplete="off"
disabledTitleText="This input is disabled"
name=""
name="name"
onChange={[Function]}
placeholder=""
size="md"
@ -247,7 +247,7 @@ exports[`ScraperTarget rendering renders correctly with url 1`] = `
autoFocus={false}
autocomplete="off"
disabledTitleText="This input is disabled"
name=""
name="url"
onChange={[Function]}
placeholder=""
size="md"