diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 16:54:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-05 16:54:15 +0300 |
commit | be834a25982746ffd85252ff502df42bb88cb9d5 (patch) | |
tree | b4d6a8ba0931e12fac08f05abea33a3b8ec2c8a2 /spec/frontend_integration/ide/ide_integration_spec.js | |
parent | ee925a3597f27e92f83a50937a64068109675b3d (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc32
Diffstat (limited to 'spec/frontend_integration/ide/ide_integration_spec.js')
-rw-r--r-- | spec/frontend_integration/ide/ide_integration_spec.js | 47 |
1 files changed, 37 insertions, 10 deletions
diff --git a/spec/frontend_integration/ide/ide_integration_spec.js b/spec/frontend_integration/ide/ide_integration_spec.js index 91d89c26ec1..c4d0c4df8de 100644 --- a/spec/frontend_integration/ide/ide_integration_spec.js +++ b/spec/frontend_integration/ide/ide_integration_spec.js @@ -1,17 +1,10 @@ -/** - * WARNING: WIP - * - * Please do not copy from this spec or use it as an example for anything. - * - * This is in place to iteratively set up the frontend integration testing environment - * and will be improved upon in a later iteration. - * - * See https://gitlab.com/gitlab-org/gitlab/-/issues/208800 for more information. - */ import { TEST_HOST } from 'helpers/test_constants'; +import { waitForText } from 'helpers/wait_for_text'; import { useOverclockTimers } from 'test_helpers/utils/overclock_timers'; +import { createCommitId } from 'test_helpers/factories/commit_id'; import { initIde } from '~/ide'; import extendStore from '~/ide/stores/extend'; +import * as ideHelper from './ide_helper'; const TEST_DATASET = { emptyStateSvgPath: '/test/empty_state.svg', @@ -59,4 +52,38 @@ describe('WebIDE', () => { expect(root).toMatchSnapshot(); }); + + it('user commits changes', async () => { + createComponent(); + + await ideHelper.createFile('foo/bar/test.txt', 'Lorem ipsum dolar sit'); + await ideHelper.deleteFile('foo/bar/.gitkeep'); + await ideHelper.commit(); + + const commitId = createCommitId(1); + const commitShortId = commitId.slice(0, 8); + + await waitForText('All changes are committed'); + await waitForText(commitShortId); + + expect(mockServer.db.branches.findBy({ name: 'master' }).commit).toMatchObject({ + short_id: commitShortId, + id: commitId, + message: 'Update foo/bar/test.txt\nDeleted foo/bar/.gitkeep', + __actions: [ + { + action: 'create', + content: 'Lorem ipsum dolar sit\n', + encoding: 'text', + file_path: 'foo/bar/test.txt', + last_commit_id: '', + }, + { + action: 'delete', + encoding: 'text', + file_path: 'foo/bar/.gitkeep', + }, + ], + }); + }); }); |