Skip to content

Commit

Permalink
test: fix breaking tests
Browse files Browse the repository at this point in the history
  • Loading branch information
thetutlage committed Jan 17, 2025
1 parent 2ef8247 commit c77969b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/templates.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ test.group('Templates', () => {
expect(window.document.querySelector('#errorStack-script')?.textContent?.trim())
.toMatchInlineSnapshot(`
"function showFormattedFrames(button) {
document.querySelector('#all-frames-toggle input[type=\\"checkbox\\"]').disabled = false
const parent = button.closest('section')
const formattedFrames = parent.querySelector('#stack-frames-formatted')
Expand All @@ -66,6 +67,7 @@ test.group('Templates', () => {
}
function showRawFrames(button) {
document.querySelector('#all-frames-toggle input[type=\\"checkbox\\"]').disabled = true
const parent = button.closest('section')
const formattedFrames = parent.querySelector('#stack-frames-formatted')
Expand All @@ -86,13 +88,28 @@ test.group('Templates', () => {
}
}
function toggleAllFrames() {
const wrapper = document.querySelector('#stack-frames-wrapper')
const indicator = document.querySelector('#all-frames-toggle input[type=\\"checkbox\\"]')
if (indicator.checked) {
wrapper.classList.add('display-all')
} else {
wrapper.classList.remove('display-all')
}
}
window.addEventListener('DOMContentLoaded', () => {
document.querySelector('#formatted-frames-toggle').addEventListener('click', function () {
showFormattedFrames(this)
})
document.querySelector('#raw-frames-toggle').addEventListener('click', function () {
showRawFrames(this)
})
document
.querySelector('#all-frames-toggle input[type=\\"checkbox\\"]')
.addEventListener('change', function () {
toggleAllFrames()
})
document.querySelectorAll('button[class=\\"stack-frame-location\\"]').forEach((sfl) => {
sfl.addEventListener('click', function (e) {
Expand Down

0 comments on commit c77969b

Please sign in to comment.