(test) Client URL optional PagerDuty
pull/15443/head^2
Zoe Steinkamp 2019-10-17 12:49:10 -06:00 committed by GitHub
commit a478e2c6f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 75 additions and 23 deletions

View File

@ -57,29 +57,6 @@ describe('Notification Endpoints', () => {
cy.contains('Slack')
})
cy.getByTestID('endpoint--dropdown-item pagerduty').click()
cy.getByTestID('endpoint--dropdown--button').within(() => {
cy.contains('Pagerduty')
})
})
cy.getByTestID('pagerduty-url')
.clear()
.type('many-faced-god.gov')
.should('have.value', 'many-faced-god.gov')
cy.getByTestID('pagerduty-routing-key')
.type('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9')
.should('have.value', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9')
cy.getByTestID('endpoint-change--dropdown')
.click()
.within(() => {
cy.getByTestID('endpoint--dropdown--button').within(() => {
cy.contains('Pagerduty')
})
cy.getByTestID('endpoint--dropdown-item http').click()
cy.getByTestID('endpoint--dropdown--button').within(() => {
@ -117,6 +94,81 @@ describe('Notification Endpoints', () => {
cy.getByTestID('endpoint--overlay').should('not.be.visible')
})
it('can create a notification endpoint pager duty with client url', () => {
const name = 'Pagerduty example'
cy.getByTestID('create-endpoint').click()
cy.getByTestID('endpoint-name--input')
.clear()
.type(name)
.should('have.value', name)
cy.getByTestID('endpoint-change--dropdown')
.click()
.within(() => {
cy.getByTestID('endpoint--dropdown--button').within(() => {
cy.contains('Slack')
})
cy.getByTestID('endpoint--dropdown-item pagerduty').click()
cy.getByTestID('endpoint--dropdown--button').within(() => {
cy.contains('Pagerduty')
})
})
cy.getByTestID('pagerduty-url')
.clear()
.type('many-faced-god.gov')
.should('have.value', 'many-faced-god.gov')
cy.getByTestID('pagerduty-routing-key')
.type('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9')
.should('have.value', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9')
cy.getByTestID('endpoint-save--button').click()
cy.getByTestID(`endpoint-card ${name}`).should('exist')
cy.getByTestID('endpoint--overlay').should('not.be.visible')
})
it('can create a notification endpoint pager duty without client url', () => {
const name = 'Pagerduty url none'
cy.getByTestID('create-endpoint').click()
cy.getByTestID('endpoint-name--input')
.clear()
.type(name)
.should('have.value', name)
cy.getByTestID('endpoint-change--dropdown')
.click()
.within(() => {
cy.getByTestID('endpoint--dropdown--button').within(() => {
cy.contains('Slack')
})
cy.getByTestID('endpoint--dropdown-item pagerduty').click()
cy.getByTestID('endpoint--dropdown--button').within(() => {
cy.contains('Pagerduty')
})
})
cy.getByTestID('pagerduty-url').clear()
cy.getByTestID('pagerduty-routing-key')
.type('eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9')
.should('have.value', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9')
cy.getByTestID('endpoint-save--button').click()
cy.getByTestID(`endpoint-card ${name}`).should('exist')
cy.getByTestID('endpoint--overlay').should('not.be.visible')
})
it('can edit a notification endpoint', () => {
cy.get<SlackNotificationEndpoint>('@endpoint').then(endpoint => {
const {name, description, url} = endpoint