summaryrefslogtreecommitdiff
path: root/spec/frontend/import_entities/import_groups/components/import_table_row_spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/import_entities/import_groups/components/import_table_row_spec.js')
-rw-r--r--spec/frontend/import_entities/import_groups/components/import_table_row_spec.js19
1 files changed, 12 insertions, 7 deletions
diff --git a/spec/frontend/import_entities/import_groups/components/import_table_row_spec.js b/spec/frontend/import_entities/import_groups/components/import_table_row_spec.js
index 7a83136e785..0c69cfb3bc5 100644
--- a/spec/frontend/import_entities/import_groups/components/import_table_row_spec.js
+++ b/spec/frontend/import_entities/import_groups/components/import_table_row_spec.js
@@ -19,7 +19,8 @@ const getFakeGroup = (status) => ({
new_name: 'group1',
},
id: 1,
- status,
+ validation_errors: [],
+ progress: { status },
});
const EXISTING_GROUP_TARGET_NAMESPACE = 'existing-group';
@@ -187,21 +188,25 @@ describe('import table row', () => {
expect(wrapper.text()).toContain('Please choose a group URL with no special characters.');
});
- it('Reports invalid group name if group already exists', async () => {
+ it('Reports invalid group name if relevant validation error exists', async () => {
+ const FAKE_ERROR_MESSAGE = 'fake error';
+
createComponent({
group: {
...getFakeGroup(STATUSES.NONE),
- import_target: {
- target_namespace: EXISTING_GROUP_TARGET_NAMESPACE,
- new_name: EXISTING_GROUP_PATH,
- },
+ validation_errors: [
+ {
+ field: 'new_name',
+ message: FAKE_ERROR_MESSAGE,
+ },
+ ],
},
});
jest.runOnlyPendingTimers();
await nextTick();
- expect(wrapper.text()).toContain('Name already exists.');
+ expect(wrapper.text()).toContain(FAKE_ERROR_MESSAGE);
});
});
});