Skip to content

Commit b1d2e9b

Browse files
committed
feedback on attr().
1 parent 006a24e commit b1d2e9b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

packages/driver/cypress/integration/cy/snapshot_spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ describe('driver/src/cy/snapshots', () => {
9999

100100
cy.createSnapshot(null, this.$el)
101101

102-
expect(attr).to.be.calledWith('data-cypress-el', true)
102+
expect(attr).to.be.calledWith('data-cypress-el', 'true')
103103
})
104104

105105
it('removes data-cypress-el attr', function () {

packages/driver/src/cy/snapshots.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,7 @@ export default {
147147
const isJqueryElement = $dom.isElement($elToHighlight) && $dom.isJquery($elToHighlight)
148148

149149
if (isJqueryElement) {
150-
// JQuery.attr doesn't support `true` as a value.
151-
// @ts-ignore
152-
($elToHighlight as JQuery<HTMLElement>).attr(HIGHLIGHT_ATTR, true)
150+
($elToHighlight as JQuery<HTMLElement>).attr(HIGHLIGHT_ATTR, 'true')
153151
}
154152

155153
// TODO: throw error here if cy is undefined!

0 commit comments

Comments
 (0)