Skip to content

Commit

Permalink
Contain changes to document
Browse files Browse the repository at this point in the history
  • Loading branch information
Juice10 committed Apr 29, 2022
1 parent 551dd64 commit 8e263d3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/rrdom/test/virtual-dom.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import * as puppeteer from 'puppeteer';
import * as rollup from 'rollup';
import resolve from '@rollup/plugin-node-resolve';
import * as typescript from 'rollup-plugin-typescript2';
import { JSDOM } from 'jsdom';
import { Mirror, NodeType, NodeType as RRNodeType } from 'rrweb-snapshot';
import {
buildFromDom,
Expand Down Expand Up @@ -48,8 +49,11 @@ describe('RRDocument for browser environment', () => {

describe('create a RRNode from a real Node', () => {
it('should support quicksmode documents', () => {
document.doctype?.remove();
expect(document.compatMode).toBe('BackCompat');
// seperate jsdom document as changes to the document would otherwise bleed into other tests
const dom = new JSDOM();
const document = dom.window.document;

expect(document.doctype).toBeNull(); // confirm compatMode is 'BackCompat' in JSDOM

const rrdom = new RRDocument();
let rrNode = buildFromNode(document, rrdom, mirror)!;
Expand Down

0 comments on commit 8e263d3

Please sign in to comment.