(fix) Client URL optional PagerDuty

This is the test to make sure this is working
pull/15448/head
Zoe Steinkamp 2019-10-17 00:33:16 -06:00
parent 0df21e2cb9
commit d43bfaab7d
1 changed files with 75 additions and 23 deletions

View File

@ -57,29 +57,6 @@ describe('Notification Endpoints', () => {
cy.contains('Slack') 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-item http').click()
cy.getByTestID('endpoint--dropdown--button').within(() => { cy.getByTestID('endpoint--dropdown--button').within(() => {
@ -117,6 +94,81 @@ describe('Notification Endpoints', () => {
cy.getByTestID('endpoint--overlay').should('not.be.visible') 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.only('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', () => { it('can edit a notification endpoint', () => {
cy.get<SlackNotificationEndpoint>('@endpoint').then(endpoint => { cy.get<SlackNotificationEndpoint>('@endpoint').then(endpoint => {
const {name, description, url} = endpoint const {name, description, url} = endpoint