Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions public/touch-gestures.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@
o.setAttribute('role', 'group');
o.setAttribute('aria-label', 'Row actions');
var hash = row.getAttribute('data-hash') || row.getAttribute('data-id') || '';
var hashAttr = ' data-hash="' + String(hash).replace(/"/g, '"') + '"';
o.innerHTML =
'<button type="button" class="row-action-btn" data-row-action="trace">Trace</button>' +
'<button type="button" class="row-action-btn" data-row-action="filter">Filter</button>' +
'<button type="button" class="row-action-btn" data-row-action="copy" data-hash="' +
String(hash).replace(/"/g, '&quot;') + '">Copy hash</button>';
'<button type="button" class="row-action-btn" data-row-action="trace"' + hashAttr + '>Trace</button>' +
'<button type="button" class="row-action-btn" data-row-action="filter"' + hashAttr + '>Filter</button>' +
'<button type="button" class="row-action-btn" data-row-action="copy"' + hashAttr + '>Copy hash</button>';
document.body.appendChild(o);
rowOverlay = o;
return o;
Expand Down
22 changes: 9 additions & 13 deletions test-touch-gestures-coverage-e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,14 +208,12 @@ async function main() {
if (!overlayPresent) {
fail('(cov1) precondition — overlay did not appear after left swipe');
} else {
await page.evaluate((h) => {
await page.evaluate(() => {
// Production stamps data-hash on trace/filter/copy buttons natively
// (issue #1305). Just click — no test-side workaround needed.
const btn = document.querySelector('.row-action-overlay [data-row-action="trace"]');
// Production only sets data-hash on the copy button; for the
// trace/filter branch in onClickAction to navigate, the button
// must carry data-hash. Stamp it here from the row's hash so
// the coverage test exercises the real navigation path.
if (btn) { btn.setAttribute('data-hash', h); btn.click(); }
}, r.hash);
if (btn) { btn.click(); }
});
await page.waitForTimeout(120);
const state = await page.evaluate(() => ({
hash: location.hash,
Expand All @@ -241,13 +239,11 @@ async function main() {
if (!ok) {
fail('(cov2) precondition — filter button not in overlay');
} else {
await page.evaluate((h) => {
await page.evaluate(() => {
// Production stamps data-hash on filter button natively (#1305).
const btn = document.querySelector('.row-action-overlay [data-row-action="filter"]');
// Same as cov1: production stamps data-hash only on the copy
// button. Stamp it on filter here so onClickAction's hash
// guard passes and we exercise the real navigation branch.
if (btn) { btn.setAttribute('data-hash', h); btn.click(); }
}, r2.hash);
if (btn) { btn.click(); }
});
await page.waitForTimeout(120);
const state = await page.evaluate(() => ({
hash: location.hash,
Expand Down