Skip to content

Commit 48037d5

Browse files
committed
Fix remaining Cypress test failures
- Use v-show instead of v-if for .infomode and .option.number so Cypress can assert .should('not.be.visible') on elements that remain in the DOM (Cypress 13 requires elements to exist before checking visibility) - Use numeric:'always' in Intl.RelativeTimeFormat so log timestamps always read "X seconds ago" rather than "now" (which lacked 'ago') - Fix .logs selector typo in 'close logs' test (should be .log) https://claude.ai/code/session_016mM8ccmRQf7mAZQn83oZRS
1 parent a35f21c commit 48037d5

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

cypress/e2e/math-tests.cy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,6 @@ describe('Math Fact Flash App', function(){
430430
it('close logs', function(){
431431
cy.get('#logs').should('be.visible')
432432
cy.get('#logs').click()
433-
cy.get('.logs').should('not.be.visible')
433+
cy.get('.log').should('not.be.visible')
434434
})
435435
})

src/App.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
<button class="info" @click="toggleinfomode()" title="?">
125125
<i class="fas fa-info"></i>
126126
</button>
127-
<dl class="infomode" v-if="infomode">
127+
<dl class="infomode" v-show="infomode">
128128
<dt>Practice Mode</dt>
129129
<dd>Play will continue forever. This is for practicing.</dd>
130130
<dt>Test Mode</dt>
@@ -134,7 +134,7 @@
134134
</dl>
135135
</label>
136136
</div>
137-
<div class="option number" v-if="mode === 'test'">
137+
<div class="option number" v-show="mode === 'test'">
138138
<label><span>Number of Cards: </span>
139139
<select id="testnumberselect" v-model.number="total_cards">
140140
<option value="5">5 cards</option>
@@ -274,7 +274,7 @@ export default {
274274
relativeTime(time) {
275275
const diff = (new Date(time).getTime() - Date.now()) / 1000
276276
const abs = Math.abs(diff)
277-
const fmt = new Intl.RelativeTimeFormat('en', { numeric: 'auto' })
277+
const fmt = new Intl.RelativeTimeFormat('en', { numeric: 'always' })
278278
if (abs < 60) return fmt.format(Math.round(diff), 'second')
279279
if (abs < 3600) return fmt.format(Math.round(diff / 60), 'minute')
280280
if (abs < 86400) return fmt.format(Math.round(diff / 3600), 'hour')

0 commit comments

Comments
 (0)