|
@@ -26,12 +26,14 @@ describe('csvwidget/table', () => {
|
|
|
let toolbar = new CSVToolbar();
|
|
|
expect(toolbar).to.be.a(CSVToolbar);
|
|
|
expect(toolbar.node.classList).to.contain('jp-CSVToolbar');
|
|
|
+ toolbar.dispose();
|
|
|
});
|
|
|
|
|
|
it('should allow pre-selecting the delimiter', () => {
|
|
|
let wanted = DELIMITERS[DELIMITERS.length - 1];
|
|
|
let toolbar = new CSVToolbar({ selected: wanted });
|
|
|
expect(toolbar.selectNode.value).to.be(wanted);
|
|
|
+ toolbar.dispose();
|
|
|
});
|
|
|
|
|
|
});
|
|
@@ -53,6 +55,35 @@ describe('csvwidget/table', () => {
|
|
|
|
|
|
});
|
|
|
|
|
|
+ describe('#selectNode', () => {
|
|
|
+
|
|
|
+ it('should return the delimiter dropdown select tag', () => {
|
|
|
+ let toolbar = new CSVToolbar();
|
|
|
+ expect(toolbar.selectNode.tagName.toLowerCase()).to.be('select');
|
|
|
+ toolbar.dispose();
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
+ describe('#dispose()', () => {
|
|
|
+
|
|
|
+ it('should dispose of the resources held by the widget', () => {
|
|
|
+ let toolbar = new CSVToolbar();
|
|
|
+ expect(toolbar.isDisposed).to.be(false);
|
|
|
+ toolbar.dispose();
|
|
|
+ expect(toolbar.isDisposed).to.be(true);
|
|
|
+ });
|
|
|
+
|
|
|
+ it('should be safe to call multiple times', () => {
|
|
|
+ let toolbar = new CSVToolbar();
|
|
|
+ expect(toolbar.isDisposed).to.be(false);
|
|
|
+ toolbar.dispose();
|
|
|
+ toolbar.dispose();
|
|
|
+ expect(toolbar.isDisposed).to.be(true);
|
|
|
+ });
|
|
|
+
|
|
|
+ });
|
|
|
+
|
|
|
});
|
|
|
|
|
|
});
|