Commit 5a828da2 authored by Jiaan Louw's avatar Jiaan Louw Committed by Jiaan Louw

Fix pipeline input resetting value while typing

This fixes the input resetting by emitting the updated value
before the fetch is called.
parent 84dbb8c2
......@@ -116,9 +116,9 @@ export default {
this.$emit('submit');
},
async updatePipelineConfiguration(path) {
this.pipelineConfigurationFileExists = await fetchPipelineConfigurationFileExists(path);
this.$emit('update:pipelineConfigurationFullPath', path);
this.pipelineConfigurationFileExists = await fetchPipelineConfigurationFileExists(path);
},
},
i18n: {
......
......@@ -224,4 +224,18 @@ describe('SharedForm', () => {
expect(wrapper.emitted('submit')).toHaveLength(1);
});
});
describe('On pipeline configuration path input', () => {
it('updates the pipelineConfigurationFullPath value', async () => {
jest.spyOn(Utils, 'fetchPipelineConfigurationFileExists').mockResolvedValue(true);
wrapper = createComponent();
await findPipelineConfigurationInput().vm.$emit('input', 'foo.yaml@bar/baz');
expect(wrapper.emitted('update:pipelineConfigurationFullPath')[0][0]).toBe(
'foo.yaml@bar/baz',
);
});
});
});
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