Skip to content

Commit 1beead0

Browse files
jgozsmacpherson64
authored andcommitted
fix: Allow SVGElement in toContainElement and toBeInTheDOM (#38)
1 parent a57e3d3 commit 1beead0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ expect.extend({toBeInTheDOM, toHaveClass})
100100
### `toBeInTheDOM`
101101

102102
```typescript
103-
toBeInTheDOM(container?: HTMLElement)
103+
toBeInTheDOM(container?: HTMLElement | SVGElement)
104104
```
105105

106106
This allows you to assert whether an element present in the DOM container or not. If no DOM container is specified it will use the default DOM context.
@@ -161,7 +161,7 @@ expect(queryByTestId(container, 'not-empty')).not.toBeEmpty()
161161
### `toContainElement`
162162

163163
```typescript
164-
toContainElement(element: HTMLElement)
164+
toContainElement(element: HTMLElement | SVGElement)
165165
```
166166

167167
This allows you to assert whether an element contains another element as a descendant or not.

extend-expect.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
declare namespace jest {
22
interface Matchers<R> {
3-
toBeInTheDOM(container?: HTMLElement): R
3+
toBeInTheDOM(container?: HTMLElement | SVGElement): R
44
toBeVisible(): R
55
toBeEmpty(): R
66
toBeDisabled(): R
7-
toContainElement(element: HTMLElement): R
7+
toContainElement(element: HTMLElement | SVGElement): R
88
toHaveAttribute(attr: string, value?: string): R
99
toHaveClass(...classNames: string[]): R
1010
toHaveStyle(css: string): R

0 commit comments

Comments
 (0)