Skip to content

Commit

Permalink
fix: Headed test title improvements (#105)
Browse files Browse the repository at this point in the history
* Separate root suite name

* Make test title copying grep-friendly

* Update src/server/pause.js
  • Loading branch information
bearfriend committed Jul 27, 2023
1 parent b4809ef commit ed42e0c
Showing 1 changed file with 29 additions and 6 deletions.
35 changes: 29 additions & 6 deletions src/server/pause.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ const controls = `
#d2l-test-controls #run {
display: flex;
gap: 0.65em;
flex-wrap: wrap;
align-items: center;
}
Expand All @@ -60,13 +59,31 @@ const controls = `
box-shadow: none;
}
#d2l-test-controls #test-name {
font-size: 0.9em;
#d2l-test-controls #title {
flex: 1;
text-align: left;
white-space: nowrap;
margin: 0 0.5em;
overflow: hidden;
}
#d2l-test-controls #test-name .title-sep {
-webkit-user-select: none;
user-select: none;
}
#d2l-test-controls #root-name {
font-size: .7em;
overflow: hidden;
text-overflow: ellipsis;
color: #999;
line-height: 1;
}
#d2l-test-controls #test-name {
font-size: 0.9em;
overflow: hidden;
text-overflow: ellipsis;
text-align: left;
}
#d2l-test-controls button {
Expand Down Expand Up @@ -129,7 +146,10 @@ const controls = `
</div>
<div id="run" hidden>
<button id="run-button" class="primary">Run</button>
<span id="test-name"></span>
<div id="title">
<div id="root-name"></div>
<div id="test-name"></div>
</div>
<button id="skip-button" class="subtle">Skip</button>
<button id="run-all-button">Run All</button>
</div>
Expand All @@ -153,6 +173,7 @@ const runBtn = document.querySelector('#run-button');
runBtn.addEventListener('click', run);

const testName = document.querySelector('#test-name');
const rootName = document.querySelector('#root-name');

/* eslint-disable no-undef, no-invalid-this */
let currentTest, focusEl = runBtn;
Expand All @@ -166,7 +187,9 @@ beforeEach(async function() {
setTimeout(async() => {
await fixture;

testName.innerText = currentTest.fullTitle();
const titlePath = currentTest.titlePath();
testName.innerHTML = testName.title = titlePath.slice(1).join('<span class="title-sep"> ></span> ');
rootName.innerText = titlePath[0];

if (test.pause) {
runBtn.disabled = false;
Expand Down

0 comments on commit ed42e0c

Please sign in to comment.