Commit 87ae36b1 authored by pburdette's avatar pburdette

Disable trigger button

When making a request disable
the trigger button until redirected.
parent 95bc54ae
......@@ -43,6 +43,7 @@ export default {
variables: [],
key: '',
secretValue: '',
triggerBtnDisabled: false,
};
},
computed: {
......@@ -98,6 +99,11 @@ export default {
1,
);
},
trigger() {
this.triggerBtnDisabled = true;
this.triggerManualJob(this.variables);
},
},
};
</script>
......@@ -182,7 +188,9 @@ export default {
variant="info"
category="primary"
:aria-label="__('Trigger manual job')"
@click="triggerManualJob(variables)"
:disabled="triggerBtnDisabled"
data-testid="trigger-manual-job-btn"
@click="trigger"
>
{{ action.button_title }}
</gl-button>
......
......@@ -23,6 +23,8 @@ describe('Manual Variables Form', () => {
});
};
const findTriggerBtn = () => wrapper.find('[data-testid="trigger-manual-job-btn"]');
beforeEach(() => {
factory(requiredProps);
});
......@@ -53,6 +55,10 @@ describe('Manual Variables Form', () => {
expect(wrapper.find('a').attributes('href')).toBe(requiredProps.variablesSettingsUrl);
});
it('trigger button is not disabled on mount', () => {
expect(findTriggerBtn().props('disabled')).toBe(false);
});
describe('when adding a new variable', () => {
it('creates a new variable when user types a new key and resets the form', (done) => {
wrapper.vm
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment