-
-
Notifications
You must be signed in to change notification settings - Fork 743
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: checking for correct resolver value in editor
- Loading branch information
1 parent
462d368
commit c858d9e
Showing
2 changed files
with
18 additions
and
1 deletion.
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
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,15 @@ | ||
import { ERROR_RESOLVER_NOT_AN_OBJECT } from '@craftjs/utils'; | ||
import { render } from '@testing-library/react'; | ||
import * as React from 'react'; | ||
|
||
import { Resolver } from '../../interfaces'; | ||
import { Editor } from '../Editor'; | ||
|
||
describe('Editor Component', () => { | ||
it('should throw an error when we use <Editor /> with resolvers that are not valid objects', () => { | ||
expect(() => { | ||
const resolver = (null as unknown) as Resolver; | ||
render(<Editor resolver={resolver} />); | ||
}).toThrowError(ERROR_RESOLVER_NOT_AN_OBJECT); | ||
}); | ||
}); |