Skip to content

Commit

Permalink
Improvements to test documentation; with Justin's help for better com…
Browse files Browse the repository at this point in the history
…prehension of why we are doing things this way
  • Loading branch information
eoghanmurray committed Dec 1, 2023
1 parent e9b0318 commit 302f855
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/rrweb-snapshot/test/snapshot.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ describe('form', () => {
it('should record textarea values once', () => {
const el = render(`<textarea>Lorem ipsum</textarea>`);
const sel = serializeNode(el) as elementNode;

// we serialize according to where the DOM stores the value, not how
// the HTML stores it (this is so that maskInputValue can work over
// inputs/textareas/selects in a uniform way)
expect(sel).toMatchObject({
attributes: {
value: 'Lorem ipsum',
Expand Down
4 changes: 2 additions & 2 deletions packages/rrweb/test/events/bad-textarea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ const events: eventWithTime[] = [
type: 2,
tagName: 'textarea',
attributes: {
value: 'dupe',
value: 'this value is used for replay',
},
childNodes: [
{
type: 3,
textContent: 'dupe should ignore',
textContent: 'this value is IGNORED for replay (but was present as a duplicte in legacy recordings)',
id: 7,
},
],
Expand Down
2 changes: 1 addition & 1 deletion packages/rrweb/test/replayer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,6 @@ describe('replayer', function () {
`);
// If the custom element is not defined, the display value will be 'none'.
// If the custom element is defined, the display value will be 'block'.
expect(displayValue).toEqual('dupe');
expect(displayValue).toEqual('this value is used for replay');
});
});

0 comments on commit 302f855

Please sign in to comment.