Skip to content

Commit

Permalink
Remember focus between tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bearfriend committed Jul 26, 2023
1 parent 70c5837 commit 9f59fba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/server/pause.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ runBtn.addEventListener('click', run);
const testName = document.querySelector('#test-name');

/* eslint-disable no-undef, no-invalid-this */
let currentTest;
let currentTest, focusEl = runBtn;
beforeEach(async function() {
const fixture = new Promise(r => test.update = r);

Expand All @@ -150,7 +150,7 @@ beforeEach(async function() {
if (test.pause) {
runBtn.disabled = false;
skipBtn.disabled = false;
runBtn.focus();
focusEl.focus();
}
});
});
Expand All @@ -163,6 +163,7 @@ function start() {
}

function run() {
focusEl = runBtn;
runBtn.disabled = true;
skipBtn.disabled = true;
test.run();
Expand All @@ -175,6 +176,7 @@ function runAll() {
}

function skip() {
focusEl = skipBtn;
run();
try {
currentTest.skip();
Expand Down

0 comments on commit 9f59fba

Please sign in to comment.