浏览代码

Test additional class name on dialog

Vidar Tonaas Fauske 8 年之前
父节点
当前提交
88e4fa3fe0
共有 1 个文件被更改,包括 14 次插入0 次删除
  1. 14 0
      test/src/dialog/dialog.spec.ts

+ 14 - 0
test/src/dialog/dialog.spec.ts

@@ -99,6 +99,20 @@ describe('dialog/index', () => {
       acceptDialog();
     });
 
+    it('should apply an additional CSS class', (done) => {
+      showDialog({ dialogClass: 'test-class' }).then(result => {
+        expect(result.text).to.be('OK');
+        done();
+      });
+      Promise.resolve().then(() => {
+        let nodes = document.body.getElementsByClassName('test-class');
+        expect(nodes.length).to.be(1);
+        let node = nodes[0];
+        expect(node.classList).to.eql(['jp-Dialog', 'test-class']);
+      });
+      acceptDialog();
+    });
+
     it('should resolve with the clicked button result', (done) => {
       let button = {
         text: 'foo',