Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ep step: allow user selection when Slack is disabled #36

Merged
merged 5 commits into from
Jul 2, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion web/src/app/escalation-policies/PolicyStepForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,9 @@ export default class PolicyStepForm extends React.Component {
data-cy='users-step'
icon={<UsersIcon />}
optional={optionalText}
onClick={this.handleStepChange(3)}
onClick={this.handleStepChange(
cfg['Slack.Enable'] ? 3 : 2,
)}
>
{badgeMeUpScotty(
getTargetsByType('user')(value.targets).length,
Expand Down
19 changes: 19 additions & 0 deletions web/src/cypress/integration/escalationPolicySteps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,23 @@ function testSteps(screen: ScreenFormat) {
})
})

it('should add users when slack is disabled', () => {
cy.updateConfig({ Slack: { Enable: false } })
cy.reload()
cy.fixture('users').then(users => {
const u1 = users[0]
const u2 = users[1]

cy.pageFab()
cy.get('div[role=dialog]').as('dialog')
cy.get('@dialog').should('contain', 'Create Step')

cy.get('button[data-cy="users-step"]').click()
cy.get('input[name=users]').selectByLabel(u1.name)
cy.get('input[name=users]').selectByLabel(u2.name)
})
})

it('should edit a step', () => {
cy.createEPStep({ epID: ep.id }).then(() => cy.reload())
cy.get('ul[data-cy=steps-list]')
Expand Down Expand Up @@ -117,6 +134,8 @@ function testSteps(screen: ScreenFormat) {
})

it('should add and then remove a slack channel', () => {
mastercactapus marked this conversation as resolved.
Show resolved Hide resolved
cy.updateConfig({ Slack: { Enable: true } })

cy.pageFab()
cy.get('div[role=dialog]').as('dialog')
cy.get('@dialog').should('contain', 'Create Step')
Expand Down
2 changes: 1 addition & 1 deletion web/src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"chance": "^1.0.16",
"css-loader": "1.0.1",
"cssnano": "^4.1.7",
"cypress": "3.3.1",
"cypress": "3.3.2",
"eslint": "^5.9.0",
"eslint-config-prettier": "5.0.0",
"eslint-config-standard": "^12.0.0",
Expand Down
25 changes: 14 additions & 11 deletions web/src/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3574,9 +3574,10 @@ cyclist@~0.2.2:
version "0.2.2"
resolved "https://registry.yarnpkg.com/cyclist/-/cyclist-0.2.2.tgz#1b33792e11e914a2fd6d6ed6447464444e5fa640"

cypress@*, cypress@3.3.1:
version "3.3.1"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-3.3.1.tgz#8a127b1d9fa74bff21f111705abfef58d595fdef"
cypress@*, cypress@3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-3.3.2.tgz#105d9283c747884d534b88a8e6c857d977887024"
integrity sha512-d2gFX0KBBdNfMMZ/ud9ouNqjDtMM3Tf5Z50hkl8Ldb8T+jKc7RLFo/4FjMu9i28T2x+50Sx8sN/kLzxr2oeWNg==
dependencies:
"@cypress/listr-verbose-renderer" "0.4.1"
"@cypress/xvfb" "1.2.4"
Expand All @@ -3591,7 +3592,7 @@ cypress@*, cypress@3.3.1:
execa "0.10.0"
executable "4.1.1"
extract-zip "1.6.7"
fs-extra "4.0.1"
fs-extra "5.0.0"
getos "3.1.1"
glob "7.1.3"
is-ci "1.2.1"
Expand Down Expand Up @@ -4929,12 +4930,13 @@ fs-constants@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad"

fs-extra@4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.1.tgz#7fc0c6c8957f983f57f306a24e5b9ddd8d0dd880"
fs-extra@5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-5.0.0.tgz#414d0110cdd06705734d055652c5411260c31abd"
integrity sha512-66Pm4RYbjzdyeuqudYqhFiNBbCIuI9kgRqLPSHIlXHidW8NIQtVdkM1yeZ4lXwuhbTETv3EUGMNHAAw6hiundQ==
dependencies:
graceful-fs "^4.1.2"
jsonfile "^3.0.0"
jsonfile "^4.0.0"
universalify "^0.1.0"

fs-minipass@^1.2.5:
Expand Down Expand Up @@ -6803,9 +6805,10 @@ json5@^2.1.0:
dependencies:
minimist "^1.2.0"

jsonfile@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-3.0.1.tgz#a5ecc6f65f53f662c4415c7675a0331d0992ec66"
jsonfile@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
integrity sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=
optionalDependencies:
graceful-fs "^4.1.6"

Expand Down