Commit 7da7af3a authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'ide-tab-active-click-fix' into 'master'

Fixed the IDE commit list item loosing its active state

Closes #48125

See merge request gitlab-org/gitlab-ce!20138
parents cab5374b bc955da8
......@@ -44,6 +44,8 @@ export default {
methods: {
...mapActions(['closeFile', 'updateDelayViewerUpdated', 'openPendingTab']),
clickFile(tab) {
if (tab.active) return;
this.updateDelayViewerUpdated(true);
if (tab.pending) {
......
......@@ -38,6 +38,26 @@ describe('RepoTab', () => {
expect(name.textContent.trim()).toEqual(vm.tab.name);
});
it('does not call openPendingTab when tab is active', done => {
vm = createComponent({
tab: {
...file(),
pending: true,
active: true,
},
});
spyOn(vm, 'openPendingTab');
vm.$el.click();
vm.$nextTick(() => {
expect(vm.openPendingTab).not.toHaveBeenCalled();
done();
});
});
it('fires clickFile when the link is clicked', () => {
vm = createComponent({
tab: file(),
......@@ -112,9 +132,9 @@ describe('RepoTab', () => {
});
it('renders a tooltip', () => {
expect(
vm.$el.querySelector('span:nth-child(2)').dataset.originalTitle,
).toContain('Locked by testuser');
expect(vm.$el.querySelector('span:nth-child(2)').dataset.originalTitle).toContain(
'Locked by testuser',
);
});
});
......
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