chore(async-table): implemented destroy in async table
This commit is contained in:
parent
29da3d795f
commit
4a63050334
@ -149,8 +149,7 @@ export class AsyncTable {
|
||||
}
|
||||
|
||||
destroy() {
|
||||
this._windowStorage.clear();
|
||||
this._historyStorage.clear();
|
||||
this._windowStorage.clear(this._windowStorage._options);
|
||||
this._eventManager.removeAllEventListenersFromUtil();
|
||||
this._active = false;
|
||||
if (this._element.classList.contains(ASYNC_TABLE_INITIALIZED_CLASS))
|
||||
|
||||
@ -52,8 +52,8 @@ describe('AsyncTable', () => {
|
||||
});
|
||||
|
||||
it('should destroy Async Table', () => {
|
||||
//asyncTable.destroy();
|
||||
asyncTable.start();
|
||||
asyncTable.destroy();
|
||||
expect(asyncTable._eventManager._registeredListeners.length).toBe(0);
|
||||
expect(asyncTable._element.classList).not.toContain(ASYNC_TABLE_INITIALIZED_CLASS);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user