Commit a615994f authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'ide-remove-stage-buttons' into 'master'

Remove stage/unstage buttons from IDE commit list items

Closes #51695

See merge request gitlab-org/gitlab-ce!21845
parents be7ac9ec 6ed79d60
...@@ -52,6 +52,7 @@ export default { ...@@ -52,6 +52,7 @@ export default {
</strong> </strong>
<changed-file-icon <changed-file-icon
:file="activeFile" :file="activeFile"
class="ml-0"
/> />
<div class="ml-auto"> <div class="ml-auto">
<button <button
......
...@@ -120,10 +120,6 @@ export default { ...@@ -120,10 +120,6 @@ export default {
:css-classes="iconClass" :css-classes="iconClass"
/> />
</div> </div>
<component
:is="actionComponent"
:path="file.path"
/>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -43,7 +43,7 @@ describe 'Multi-file editor new directory', :js do ...@@ -43,7 +43,7 @@ describe 'Multi-file editor new directory', :js do
find('.js-ide-commit-mode').click find('.js-ide-commit-mode').click
find('.multi-file-commit-list-item').hover find('.multi-file-commit-list-item').hover
first('.multi-file-discard-btn .btn').click click_button 'Stage'
fill_in('commit-message', with: 'commit message ide') fill_in('commit-message', with: 'commit message ide')
......
...@@ -35,7 +35,7 @@ describe 'Multi-file editor new file', :js do ...@@ -35,7 +35,7 @@ describe 'Multi-file editor new file', :js do
find('.js-ide-commit-mode').click find('.js-ide-commit-mode').click
find('.multi-file-commit-list-item').hover find('.multi-file-commit-list-item').hover
first('.multi-file-discard-btn .btn').click click_button 'Stage'
fill_in('commit-message', with: 'commit message ide') fill_in('commit-message', with: 'commit message ide')
......
...@@ -33,10 +33,6 @@ describe('Multi-file editor commit sidebar list item', () => { ...@@ -33,10 +33,6 @@ describe('Multi-file editor commit sidebar list item', () => {
expect(vm.$el.querySelector('.multi-file-commit-list-path').textContent).toContain(f.path); expect(vm.$el.querySelector('.multi-file-commit-list-path').textContent).toContain(f.path);
}); });
it('renders actionn button', () => {
expect(vm.$el.querySelector('.multi-file-discard-btn')).not.toBeNull();
});
it('opens a closed file in the editor when clicking the file path', done => { it('opens a closed file in the editor when clicking the file path', done => {
spyOn(vm, 'openPendingTab').and.callThrough(); spyOn(vm, 'openPendingTab').and.callThrough();
spyOn(router, 'push'); spyOn(router, 'push');
......
...@@ -103,65 +103,6 @@ describe('RepoCommitSection', () => { ...@@ -103,65 +103,6 @@ describe('RepoCommitSection', () => {
}); });
}); });
it('adds changed files into staged files', done => {
vm.$el.querySelector('.multi-file-discard-btn .btn').click();
vm
.$nextTick()
.then(() => vm.$el.querySelector('.multi-file-discard-btn .btn').click())
.then(vm.$nextTick)
.then(() => {
expect(vm.$el.querySelector('.ide-commit-list-container').textContent).toContain(
'There are no unstaged changes',
);
})
.then(done)
.catch(done.fail);
});
it('stages a single file', done => {
vm.$el.querySelector('.multi-file-discard-btn .btn').click();
Vue.nextTick(() => {
expect(
vm.$el
.querySelector('.ide-commit-list-container')
.querySelectorAll('.multi-file-commit-list > li').length,
).toBe(1);
done();
});
});
it('discards a single file', done => {
vm.$el.querySelector('.multi-file-commit-list li:first-child .js-modal-primary-action').click();
Vue.nextTick(() => {
expect(vm.$el.querySelector('.ide-commit-list-container').textContent).not.toContain('file1');
expect(
vm.$el
.querySelector('.ide-commit-list-container')
.querySelectorAll('.multi-file-commit-list > li').length,
).toBe(1);
done();
});
});
it('unstages a single file', done => {
vm.$el
.querySelectorAll('.multi-file-discard-btn')[2]
.querySelector('.btn')
.click();
Vue.nextTick(() => {
expect(
vm.$el.querySelectorAll('.ide-commit-list-container')[1].querySelectorAll('li').length,
).toBe(1);
done();
});
});
describe('mounted', () => { describe('mounted', () => {
it('opens last opened file', () => { it('opens last opened file', () => {
expect(store.state.openFiles.length).toBe(1); expect(store.state.openFiles.length).toBe(1);
......
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