@gregoriusrippenstein/erlang-red-unittest 0.20.0 → 0.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gregoriusrippenstein/erlang-red-unittest",
3
- "version": "0.20.0",
3
+ "version": "0.20.2",
4
4
  "dependencies": {
5
5
  },
6
6
 
@@ -367,8 +367,7 @@ function runAllTests(dirList, withLimit) {
367
367
  }
368
368
 
369
369
  // Add your plugin as a new tabsheet in the right sidebar AFTER the flow editor is completely started
370
- var initialiseConfigNodeOnce = () => {
371
- RED.events.off('runtime-state', initialiseConfigNodeOnce);
370
+ var initSidebarForUnittest = () => {
372
371
 
373
372
  var content = $($('script[type="text/x-red"][data-template-name="UnitTestingSidebar"]').i18n().html());
374
373
 
@@ -554,8 +553,6 @@ let handledStoppedStatus = (data) => {
554
553
  }
555
554
  }
556
555
 
557
- RED.comms.subscribe('unittesting:testresults', handleTestResult);
558
-
559
556
  $('#node-input-unittestingpull-expand-all-but').on('click', function (e) {
560
557
  e.preventDefault();
561
558
  expandAllTests(dirList)
@@ -587,33 +584,6 @@ $('#node-input-unittestingpull-sb-refresh-list-but').on('click', function (e) {
587
584
  }, 150);
588
585
  });
589
586
 
590
- // debugging
591
- window.unitTestDirList = dirList;
592
- window.fakeTestResult = handleTestResult;
593
-
594
- if (RED.comms.on) {
595
- // RED.comms.on is not available on NR 3.x
596
- RED.comms.on("connect", () => {
597
- $('#node-input-unittestingpull-sb-testall-but').prop('disabled', false)
598
- $('#node-input-unittestingpull-sb-test-flow-but').prop('disabled', false)
599
- $('#node-input-unittestingpull-sb-test-workspace-but').prop('disabled', false)
600
- });
601
-
602
- RED.comms.on("disconnect", () => {
603
- $('#node-input-unittestingpull-sb-testall-but').prop('disabled', true)
604
- $('#node-input-unittestingpull-sb-test-flow-but').prop('disabled', true)
605
- $('#node-input-unittestingpull-sb-test-workspace-but').prop('disabled', true)
606
- });
607
-
608
- if ( !RED.comms.isConnected || RED.comms.isConnected() ) {
609
- $('#node-input-unittestingpull-sb-testall-but').prop('disabled', false)
610
- $('#node-input-unittestingpull-sb-test-flow-but').prop('disabled', false)
611
- $('#node-input-unittestingpull-sb-test-workspace-but').prop('disabled', false)
612
- }
613
- } else {
614
- $('#node-input-unittestingpull-sb-test-workspace-but').prop('disabled', false)
615
- }
616
-
617
587
  RED.actions.add("unittesting:send-halt-to-test-server", sendUnittestngHalt)
618
588
  RED.actions.add("unittesting:test-current-workspace", testCurrentWorkspace)
619
589
  RED.actions.add("unittesting:run-all-tests", () => { runAllTests(dirList) } )
@@ -682,14 +652,49 @@ $('#node-input-unittestingselect-test-node').on('click', (e) => {
682
652
  RED.view.select({ nodes: slNodes.map(n => RED.nodes.node(n)) })
683
653
  }
684
654
  })
655
+
656
+ let inittestunitcomm = () => {
657
+ RED.events.off('flows:loaded', inittestunitcomm);
658
+
659
+ // debugging
660
+ window.unitTestDirList = dirList;
661
+ window.fakeTestResult = handleTestResult;
662
+
663
+ if (RED.comms.on) {
664
+ // RED.comms.on is not available on NR 3.x
665
+ RED.comms.on("connect", () => {
666
+ $('#node-input-unittestingpull-sb-testall-but').prop('disabled', false)
667
+ $('#node-input-unittestingpull-sb-test-flow-but').prop('disabled', false)
668
+ $('#node-input-unittestingpull-sb-test-workspace-but').prop('disabled', false)
669
+ });
670
+
671
+ RED.comms.on("disconnect", () => {
672
+ $('#node-input-unittestingpull-sb-testall-but').prop('disabled', true)
673
+ $('#node-input-unittestingpull-sb-test-flow-but').prop('disabled', true)
674
+ $('#node-input-unittestingpull-sb-test-workspace-but').prop('disabled', true)
675
+ });
676
+
677
+ if ( !RED.comms.isConnected || RED.comms.isConnected() ) {
678
+ $('#node-input-unittestingpull-sb-testall-but').prop('disabled', false)
679
+ $('#node-input-unittestingpull-sb-test-flow-but').prop('disabled', false)
680
+ $('#node-input-unittestingpull-sb-test-workspace-but').prop('disabled', false)
681
+ }
682
+ } else {
683
+ $('#node-input-unittestingpull-sb-test-workspace-but').prop('disabled', false)
684
+ }
685
+
686
+ RED.comms.subscribe('unittesting:testresults', handleTestResult);
687
+ }
688
+ RED.events.on('flows:loaded', inittestunitcomm);
685
689
  };
686
-
687
- RED.events.on('runtime-state', initialiseConfigNodeOnce);
690
+
691
+ RED.plugins.registerPlugin("unittesting-sidebar-plugin", { onadd: initSidebarForUnittest });
688
692
  })();
689
693
  </script>
690
694
 
691
695
  <!-- The html for the right sidebar plugin screen -->
692
696
  <script type="text/x-red" data-template-name="UnitTestingSidebar">
697
+ <div style="position: relative; height: 100%; overflow-y: auto;">
693
698
  <div class="form-row func-unittesting-tabs-row">
694
699
  <ul style="min-width: 600px; margin-bottom: 20px;" id="func-unittesting-tabs"></ul>
695
700
  </div>
@@ -793,4 +798,5 @@ $('#node-input-unittestingselect-test-node').on('click', (e) => {
793
798
  <!--func-unittesting-tab-tab#-->
794
799
  </div>
795
800
  <!--func-unittesting-tabs-content-->
801
+ </div>
796
802
  </script>