Commit 00ced96c authored by Phil Hughes's avatar Phil Hughes

added specs for is-active class

added spec for openPendingTab in component
parent e1ec70cf
......@@ -90,4 +90,20 @@ describe('Multi-file editor commit sidebar list item', () => {
});
});
});
describe('is active', () => {
it('does not add active class when dont keys match', () => {
expect(vm.$el.classList).not.toContain('is-active');
});
it('adds active class when keys match', done => {
vm.keyPrefix = 'staged';
vm.$nextTick(() => {
expect(vm.$el.classList).toContain('is-active');
done();
});
});
});
});
......@@ -56,6 +56,8 @@ describe('RepoCommitSection', () => {
vm.$store.state.entries[f.path] = f;
});
spyOn(vm, 'openPendingTab').and.callThrough();
return vm.$mount();
}
......@@ -177,5 +179,12 @@ describe('RepoCommitSection', () => {
expect(store.state.openFiles.length).toBe(1);
expect(store.state.openFiles[0].pending).toBe(true);
});
it('calls openPendingTab', () => {
expect(vm.openPendingTab).toHaveBeenCalledWith({
file: vm.lastOpenedFile,
keyPrefix: 'unstaged',
});
});
});
});
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