Skip to content
This repository was archived by the owner on Dec 17, 2024. It is now read-only.

Commit b2eb8df

Browse files
committed
fix for buggy drilldown from summary table to grid
Fixes #780
1 parent 6b70fec commit b2eb8df

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

app/plugins/modules/activation-visualizations/lib/table.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,7 @@ const _drawTable = (options, header, content, groupData, eventBus, sorter=defaul
572572
} else {
573573
// drill down to grid, showing just successes
574574
cell.classList.add('clickable')
575-
cell.onclick = drilldownWith(viewName, `grid ${optionsToString(options)} --success --zoom 1 --name "${group.path}" ${splitOptions}`)
575+
cell.onclick = drilldownWith(viewName, `grid "${group.path}" ${optionsToString(options)} --success ${splitOptions}`)
576576
}
577577
cell.appendChild(countPart)
578578
countPart.innerText = group.nSuccesses
@@ -602,7 +602,7 @@ const _drawTable = (options, header, content, groupData, eventBus, sorter=defaul
602602

603603
// drill down to grid, showing just failures
604604
cell.classList.add('clickable')
605-
cell.onclick = drilldownWith(viewName, `grid ${optionsToString(options)} --failure --zoom 1 --name "${group.path}" ${splitOptions}`)
605+
cell.onclick = drilldownWith(viewName, `grid "${group.path}" ${optionsToString(options)} --failure ${splitOptions}`)
606606
if (group.nFailures === 0) {
607607
cell.classList.add('count-is-zero')
608608
cell.classList.remove('clickable')

tests/tests/passes/05/activation-table-view.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const parsesAsInteger = str => {
3434
}
3535
const isInteger = str => typeof str === 'number' || parsesAsInteger(str)
3636

37-
const openTableExpectCountOf = function(ctx, expectedCount, expectedErrorRate, cmd) {
37+
const _openTableExpectCountOf = function(ctx, expectedCount, expectedErrorRate, cmd) {
3838
const view = `${ui.selectors.SIDECAR_CUSTOM_CONTENT} .activation-viz-plugin`,
3939
row = `${view} tr[data-action-name="${actionName}"]`,
4040
successCell = `${row} .cell-successes.cell-hide-when-outliers-shown`,
@@ -79,7 +79,12 @@ const openTableExpectCountOf = function(ctx, expectedCount, expectedErrorRate, c
7979
}
8080
});
8181

82-
it(`open activation table, with ${cmd}`, () => new Promise((resolve, reject) => once(0, resolve, reject)))
82+
return new Promise((resolve, reject) => once(0, resolve, reject))
83+
}
84+
const openTableExpectCountOf = function() {
85+
const cmd = arguments[arguments.length - 1]
86+
87+
it(`open activation table, with ${cmd}`, () => _openTableExpectCountOf.apply(this, arguments))
8388
}
8489
exports.openTableExpectCountOf = openTableExpectCountOf
8590

@@ -150,6 +155,15 @@ describe('Activation table visualization', function() {
150155
openTableExpectCountOf(this, 3, 1, 'summary')
151156
openTableExpectCountOf(this, 3, 1, 'summary --batches 10')
152157

158+
it('should open table, click on a failure cell, and show grid', () => _openTableExpectCountOf(this, 3, 1, 'summary --batches 10')
159+
.then(() => `${ui.selectors.SIDECAR_CUSTOM_CONTENT} tr[data-action-name="${actionName}"] .cell-errors`)
160+
.then(selector => this.app.client.scroll(selector)
161+
.then(this.app.client.click(selector)))
162+
.then(() => this.app)
163+
.then(sidecar.expectOpen)
164+
.then(sidecar.expectMode('grid'))
165+
.catch(common.oops(this)))
166+
153167
// force a version update
154168
it('should create the action that bombs if the input value is negative', () => cli.do(`let ${actionName} = ({x}) => x<0 ? {error:'bomb!'} : {x: x}`, this.app)
155169
.then(cli.expectOK)

0 commit comments

Comments
 (0)