chore(async-table): implemented destroy in async table

This commit is contained in:
Johannes Eder 2021-06-30 16:59:45 +02:00 committed by Sarah Vaupel
parent 29da3d795f
commit 4a63050334
2 changed files with 2 additions and 3 deletions

View File

@ -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))

View File

@ -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);
});