Skip to content

Commit

Permalink
fix: Allow SVGElement in toContainElement and toBeInTheDOM (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
jgoz authored and smacpherson64 committed Jul 11, 2018
1 parent a57e3d3 commit 1beead0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ expect.extend({toBeInTheDOM, toHaveClass})
### `toBeInTheDOM`

```typescript
toBeInTheDOM(container?: HTMLElement)
toBeInTheDOM(container?: HTMLElement | SVGElement)
```

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.
Expand Down Expand Up @@ -161,7 +161,7 @@ expect(queryByTestId(container, 'not-empty')).not.toBeEmpty()
### `toContainElement`

```typescript
toContainElement(element: HTMLElement)
toContainElement(element: HTMLElement | SVGElement)
```

This allows you to assert whether an element contains another element as a descendant or not.
Expand Down
4 changes: 2 additions & 2 deletions extend-expect.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
declare namespace jest {
interface Matchers<R> {
toBeInTheDOM(container?: HTMLElement): R
toBeInTheDOM(container?: HTMLElement | SVGElement): R
toBeVisible(): R
toBeEmpty(): R
toBeDisabled(): R
toContainElement(element: HTMLElement): R
toContainElement(element: HTMLElement | SVGElement): R
toHaveAttribute(attr: string, value?: string): R
toHaveClass(...classNames: string[]): R
toHaveStyle(css: string): R
Expand Down

0 comments on commit 1beead0

Please sign in to comment.