-
-
Notifications
You must be signed in to change notification settings - Fork 231
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(core-utils): remove domino from the codebase (#1833)
- Loading branch information
Showing
8 changed files
with
86 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@remirror/core-utils': patch | ||
--- | ||
|
||
Removes `domino` from the codebase. |
53 changes: 53 additions & 0 deletions
53
packages/remirror__core-utils/__tests__/core-utils.node.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* @jest-environment node | ||
*/ | ||
|
||
import { doc, p, schema as testSchema } from 'jest-prosemirror'; | ||
|
||
import { htmlToProsemirrorNode, prosemirrorNodeToDom } from '../'; | ||
|
||
describe('toDOM', () => { | ||
const node = doc(p('hello')); | ||
|
||
it('allows for custom document to be passed in', async () => { | ||
const { JSDOM } = await import('jsdom'); | ||
const customDocument = new JSDOM().window.document; | ||
expect(prosemirrorNodeToDom(node, customDocument)).toBeObject(); | ||
|
||
const wrongDocument = {} as Document; | ||
expect(() => prosemirrorNodeToDom(node, customDocument)).not.toThrow(); | ||
expect(() => prosemirrorNodeToDom(node, wrongDocument)).toThrow(); | ||
}); | ||
}); | ||
|
||
describe('htmlToProsemirrorNode', () => { | ||
const content = `<p>Hello</p>`; | ||
|
||
it('allows for custom document to be passed in', async () => { | ||
const { JSDOM } = await import('jsdom'); | ||
const customDocument = new JSDOM().window.document; | ||
expect( | ||
htmlToProsemirrorNode({ | ||
content: content, | ||
schema: testSchema, | ||
document: customDocument, | ||
}), | ||
).toEqualProsemirrorNode(doc(p('Hello'))); | ||
|
||
const wrongDocument = {} as Document; | ||
expect(() => | ||
htmlToProsemirrorNode({ | ||
content: content, | ||
schema: testSchema, | ||
document: customDocument, | ||
}), | ||
).not.toThrow(); | ||
expect(() => | ||
htmlToProsemirrorNode({ | ||
content: content, | ||
schema: testSchema, | ||
document: wrongDocument, | ||
}), | ||
).toThrow(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d3248ad
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Deployed on https://main--remirror.netlify.app