mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fix clear history.
This commit is contained in:
committed by
Dave Page
parent
fae185ff66
commit
fc78202600
@@ -10,13 +10,15 @@
|
||||
import HistoryCollection from '../../../pgadmin/static/js/history/history_collection';
|
||||
|
||||
describe('historyCollection', function () {
|
||||
let historyCollection, historyModel, onChangeSpy;
|
||||
let historyCollection, historyModel, onChangeSpy, onResetSpy;
|
||||
beforeEach(() => {
|
||||
historyModel = [{some: 'thing', someOther: ['array element']}];
|
||||
historyCollection = new HistoryCollection(historyModel);
|
||||
onChangeSpy = jasmine.createSpy('onChangeHandler');
|
||||
onResetSpy = jasmine.createSpy('onResetHandler');
|
||||
|
||||
historyCollection.onChange(onChangeSpy);
|
||||
historyCollection.onReset(onResetSpy);
|
||||
});
|
||||
|
||||
describe('length', function () {
|
||||
@@ -61,8 +63,8 @@ describe('historyCollection', function () {
|
||||
expect(historyCollection.length()).toBe(0);
|
||||
});
|
||||
|
||||
it('calls the onChange function', function () {
|
||||
expect(onChangeSpy).toHaveBeenCalledWith([]);
|
||||
it('calls the onReset function', function () {
|
||||
expect(onResetSpy).toHaveBeenCalledWith([]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user