Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/import_entities/import_projects')
-rw-r--r--spec/frontend/import_entities/import_projects/components/import_projects_table_spec.js2
-rw-r--r--spec/frontend/import_entities/import_projects/components/provider_repo_table_row_spec.js7
-rw-r--r--spec/frontend/import_entities/import_projects/store/mutations_spec.js29
3 files changed, 37 insertions, 1 deletions
diff --git a/spec/frontend/import_entities/import_projects/components/import_projects_table_spec.js b/spec/frontend/import_entities/import_projects/components/import_projects_table_spec.js
index 16adf88700f..88fcedd31b2 100644
--- a/spec/frontend/import_entities/import_projects/components/import_projects_table_spec.js
+++ b/spec/frontend/import_entities/import_projects/components/import_projects_table_spec.js
@@ -31,7 +31,7 @@ describe('ImportProjectsTable', () => {
const findImportAllButton = () =>
wrapper
.findAll(GlButton)
- .filter((w) => w.props().variant === 'success')
+ .filter((w) => w.props().variant === 'confirm')
.at(0);
const findImportAllModal = () => wrapper.find({ ref: 'importAllModal' });
diff --git a/spec/frontend/import_entities/import_projects/components/provider_repo_table_row_spec.js b/spec/frontend/import_entities/import_projects/components/provider_repo_table_row_spec.js
index c8afa9ea57d..41a005199e1 100644
--- a/spec/frontend/import_entities/import_projects/components/provider_repo_table_row_spec.js
+++ b/spec/frontend/import_entities/import_projects/components/provider_repo_table_row_spec.js
@@ -98,6 +98,8 @@ describe('ProviderRepoTableRow', () => {
});
describe('when rendering imported project', () => {
+ const FAKE_STATS = {};
+
const repo = {
importSource: {
id: 'remote-1',
@@ -109,6 +111,7 @@ describe('ProviderRepoTableRow', () => {
fullPath: 'fullPath',
importSource: 'importSource',
importStatus: STATUSES.FINISHED,
+ stats: FAKE_STATS,
},
};
@@ -134,6 +137,10 @@ describe('ProviderRepoTableRow', () => {
it('does not render import button', () => {
expect(findImportButton().exists()).toBe(false);
});
+
+ it('passes stats to import status component', () => {
+ expect(wrapper.find(ImportStatus).props().stats).toBe(FAKE_STATS);
+ });
});
describe('when rendering incompatible project', () => {
diff --git a/spec/frontend/import_entities/import_projects/store/mutations_spec.js b/spec/frontend/import_entities/import_projects/store/mutations_spec.js
index e062d889325..77fae951300 100644
--- a/spec/frontend/import_entities/import_projects/store/mutations_spec.js
+++ b/spec/frontend/import_entities/import_projects/store/mutations_spec.js
@@ -232,6 +232,35 @@ describe('import_projects store mutations', () => {
updatedProjects[0].importStatus,
);
});
+
+ it('updates import stats of project', () => {
+ const repoId = 1;
+ state = {
+ repositories: [
+ { importedProject: { id: repoId, stats: {} }, importStatus: STATUSES.STARTED },
+ ],
+ };
+ const newStats = {
+ fetched: {
+ label: 10,
+ },
+ imported: {
+ label: 1,
+ },
+ };
+
+ const updatedProjects = [
+ {
+ id: repoId,
+ importStatus: STATUSES.FINISHED,
+ stats: newStats,
+ },
+ ];
+
+ mutations[types.RECEIVE_JOBS_SUCCESS](state, updatedProjects);
+
+ expect(state.repositories[0].importedProject.stats).toStrictEqual(newStats);
+ });
});
describe(`${types.REQUEST_NAMESPACES}`, () => {