Commit 0945fa04 authored by Mike Greiling's avatar Mike Greiling

ensure hasSHAChanged == true when setData includes a different SHA from constructor

parent f19ec4e2
import MergeRequestStore from '~/vue_merge_request_widget/stores/mr_widget_store';
import mockData from '../mock_data';
describe('MergeRequestStore', () => {
describe('setData', () => {
let store;
beforeEach(() => {
store = new MergeRequestStore(mockData);
});
it('should set hasSHAChanged when the diff SHA changes', () => {
store.setData({ ...mockData, diff_head_sha: 'a-different-string' });
expect(store.hasSHAChanged).toBe(true);
});
it('should not set hasSHAChanged when other data changes', () => {
store.setData({ ...mockData, work_in_progress: !mockData.work_in_progress });
expect(store.hasSHAChanged).toBe(false);
});
});
});
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