From 84feae02ec37c8d51008692e2f63de9ff9eb4d0c Mon Sep 17 00:00:00 2001 From: Justin Pealing Date: Thu, 16 Nov 2017 23:19:08 +0000 Subject: [PATCH] Fix #46 - SP nodes shown incorrectly The default recursive template for NodeLabel was causing issues and there was nothing to handle showing the SP name or to identify the node type as SP. --- src/qp.xslt | 8 ++++++++ test/qp_test.js | 21 +++++++++++++++++++++ test_plans/many_lines2.sqlplan | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/qp.xslt b/src/qp.xslt index 97f1c64..1b96f56 100644 --- a/src/qp.xslt +++ b/src/qp.xslt @@ -7,6 +7,7 @@ + @@ -351,6 +352,11 @@
Statement
+ + +
Procedure Name
+
+
Order By
@@ -477,6 +483,8 @@ + + Stored Procedure Dynamic Fast Forward diff --git a/test/qp_test.js b/test/qp_test.js index 7c6c9e0..5830445 100644 --- a/test/qp_test.js +++ b/test/qp_test.js @@ -18,6 +18,7 @@ let plan_Cursor2 = require('raw!../test_plans/cursors/cursor2.sqlplan'); let plan_batchMode = require('raw!../test_plans/batch mode.sqlplan'); let plan_batchModeEstimated = require('raw!../test_plans/batch mode estimated.sqlplan'); let plan_issue39 = require('raw!../test_plans/issue_39.sqlplan'); +let plan_manyLines = require('raw!../test_plans/many_lines2.sqlplan'); describe('qp.js', () => { @@ -216,6 +217,26 @@ describe('qp.js', () => { assert.equal('PRINT', printNode.children[1].innerText); }); + + describe('Stored Procedure Node', () => { + + it('Has Stored Procedure as node text', () => { + + let container = helper.showPlan(plan_manyLines); + let sp = container.querySelectorAll('.qp-node')[1]; + assert.equal('Stored Procedure', sp.children[1].innerText); + + }) + + it('Has Procedure Name in tooltip', () => { + + let container = helper.showPlan(plan_manyLines); + let sp = container.querySelectorAll('.qp-node')[1]; + assert.equal('TEST', helper.getToolTipSection(sp, 'Procedure Name')); + + }); + + }); describe('Tooltip Ordered Property', () => { diff --git a/test_plans/many_lines2.sqlplan b/test_plans/many_lines2.sqlplan index 322f406..acc2fb8 100644 --- a/test_plans/many_lines2.sqlplan +++ b/test_plans/many_lines2.sqlplan @@ -1,4 +1,4 @@ - +