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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-07-18 15:10:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-07-18 15:10:09 +0300
commit4c3f961bd94656e64cee5b0ad07b3f49a84338a5 (patch)
treeeb9afef2d82734c64869ab4a78b99ea6d1805501 /spec/frontend/ci/pipeline_editor
parent16887b928c9b4f26aabdb2f37ec5fe4ee97e73fe (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/ci/pipeline_editor')
-rw-r--r--spec/frontend/ci/pipeline_editor/components/commit/commit_section_spec.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/spec/frontend/ci/pipeline_editor/components/commit/commit_section_spec.js b/spec/frontend/ci/pipeline_editor/components/commit/commit_section_spec.js
index 8834231aaef..7a9b4ffdce8 100644
--- a/spec/frontend/ci/pipeline_editor/components/commit/commit_section_spec.js
+++ b/spec/frontend/ci/pipeline_editor/components/commit/commit_section_spec.js
@@ -17,7 +17,8 @@ import {
import { resolvers } from '~/ci/pipeline_editor/graphql/resolvers';
import commitCreate from '~/ci/pipeline_editor/graphql/mutations/commit_ci_file.mutation.graphql';
import getCurrentBranch from '~/ci/pipeline_editor/graphql/queries/client/current_branch.query.graphql';
-import updatePipelineEtag from '~/ci/pipeline_editor/graphql/mutations/client/update_pipeline_etag.mutation.graphql';
+import getPipelineEtag from '~/ci/pipeline_editor/graphql/queries/client/pipeline_etag.query.graphql';
+
import {
mockCiConfigPath,
mockCiYml,
@@ -253,18 +254,20 @@ describe('Pipeline Editor | Commit section', () => {
describe('when the commit returns a different etag path', () => {
beforeEach(async () => {
createComponentWithApollo();
- jest.spyOn(wrapper.vm.$apollo, 'mutate');
+ jest.spyOn(mockApollo.clients.defaultClient.cache, 'writeQuery');
+
mockMutateCommitData.mockResolvedValue(mockCommitCreateResponseNewEtag);
await submitCommit();
});
- it('calls the client mutation to update the etag', () => {
- // 1:Commit submission, 2:etag update, 3:currentBranch update, 4:lastCommit update
- expect(wrapper.vm.$apollo.mutate).toHaveBeenCalledTimes(4);
- expect(wrapper.vm.$apollo.mutate).toHaveBeenNthCalledWith(2, {
- mutation: updatePipelineEtag,
- variables: {
- pipelineEtag: mockCommitCreateResponseNewEtag.data.commitCreate.commitPipelinePath,
+ it('calls the client mutation to update the etag in the cache', () => {
+ expect(mockApollo.clients.defaultClient.cache.writeQuery).toHaveBeenCalledWith({
+ query: getPipelineEtag,
+ data: {
+ etags: {
+ __typename: 'EtagValues',
+ pipeline: mockCommitCreateResponseNewEtag.data.commitCreate.commitPipelinePath,
+ },
},
});
});