Commit bc955da8 authored by Phil Hughes's avatar Phil Hughes

Fixed the IDE commit list item loosing its active state

Closes #48125
parent 9490c378
......@@ -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