Skip to content

Commit 78ba7ff

Browse files
committed
Update logic and tests
1 parent 7fdee92 commit 78ba7ff

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/components/cylc/cylcObject/Menu.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ export default {
239239
}
240240
},
241241
isDisabled (mutation, authorised) {
242-
if (((mutation._validStates.indexOf(this.node.node.status)) === -1) || !authorised) {
242+
if (((!mutation._validStates.includes(this.node.node.status))) || !authorised) {
243243
return true
244244
}
245245
return false

tests/unit/utils/aotf.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ describe('aotf (Api On The Fly)', () => {
6363
it('should add computed fields', () => {
6464
const input = {
6565
name: 'fooBar',
66-
description: 'Short description.\n\nLong\ndescription.\nValid for: [\'stopped\'] workflows.',
66+
description: 'Short description.\n\nLong\ndescription.\nValid for: stopped workflows.',
6767
args: []
6868
}
6969
const output = {
7070
...input,
7171
_title: 'Foo Bar',
7272
_icon: aotf.mutationIcons[''],
7373
_shortDescription: 'Short description.',
74-
_help: 'Long\ndescription.\nValid for: [\'stopped\'] workflows.',
75-
_validStates: "['stopped']"
74+
_help: 'Long\ndescription.\nValid for: stopped workflows.',
75+
_validStates: 'stopped'
7676
}
7777
aotf.processMutations([input], null)
7878
expect(input).to.deep.equal(output)

0 commit comments

Comments
 (0)