diff --git a/src/__tests__/element-queries.js b/src/__tests__/element-queries.js
index 0739ea37..83a897f4 100644
--- a/src/__tests__/element-queries.js
+++ b/src/__tests__/element-queries.js
@@ -1,6 +1,16 @@
-import {configure} from '../config'
+import {configure, getConfig} from '../config'
import {render, renderIntoDocument} from './helpers/test-utils'
+// set original config
+let originalConfig
+beforeAll(() => {
+ originalConfig = getConfig()
+})
+
+afterEach(() => {
+ configure(originalConfig)
+})
+
test('query can return null', () => {
const {
queryByLabelText,
@@ -35,7 +45,7 @@ test('get throws a useful error message', () => {
.toThrowErrorMatchingInlineSnapshot(`
Unable to find a label with the text of: LucyRicardo
- Ignored nodes: comments, ,
+ Ignored nodes: comments, script, style
@@ -44,7 +54,7 @@ test('get throws a useful error message', () => {
.toThrowErrorMatchingInlineSnapshot(`
Unable to find an element with the placeholder text of: LucyRicardo
- Ignored nodes: comments, ,
+ Ignored nodes: comments, script, style
@@ -52,7 +62,7 @@ test('get throws a useful error message', () => {
expect(() => getByText('LucyRicardo')).toThrowErrorMatchingInlineSnapshot(`
Unable to find an element with the text: LucyRicardo. This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.
- Ignored nodes: comments, ,
+ Ignored nodes: comments, script, style
@@ -61,7 +71,7 @@ test('get throws a useful error message', () => {
.toThrowErrorMatchingInlineSnapshot(`
Unable to find an element with the text: Lucy Ricardo (normalized from 'Lucy Ricardo'). This could be because the text is broken up by multiple elements. In this case, you can provide a function for your text matcher to make your matcher more flexible.
- Ignored nodes: comments, ,
+ Ignored nodes: comments, script, style
@@ -69,7 +79,7 @@ test('get throws a useful error message', () => {
expect(() => getByTestId('LucyRicardo')).toThrowErrorMatchingInlineSnapshot(`
Unable to find an element by: [data-testid="LucyRicardo"]
- Ignored nodes: comments, ,
+ Ignored nodes: comments, script, style
@@ -77,7 +87,7 @@ test('get throws a useful error message', () => {
expect(() => getByAltText('LucyRicardo')).toThrowErrorMatchingInlineSnapshot(`
Unable to find an element with the alt text: LucyRicardo
- Ignored nodes: comments, ,
+ Ignored nodes: comments, script, style
@@ -85,7 +95,7 @@ test('get throws a useful error message', () => {
expect(() => getByTitle('LucyRicardo')).toThrowErrorMatchingInlineSnapshot(`
Unable to find an element with the title: LucyRicardo.
- Ignored nodes: comments, ,
+ Ignored nodes: comments, script, style
@@ -94,7 +104,7 @@ test('get throws a useful error message', () => {
.toThrowErrorMatchingInlineSnapshot(`
Unable to find an element with the display value: LucyRicardo.
- Ignored nodes: comments, ,
+ Ignored nodes: comments, script, style
@@ -104,7 +114,7 @@ test('get throws a useful error message', () => {
There are no accessible roles. But there might be some inaccessible roles. If you wish to access them, then set the \`hidden\` option to \`true\`. Learn more about this here: https://testing-library.com/docs/dom-testing-library/api-queries#byrole
- Ignored nodes: comments, ,
+ Ignored nodes: comments, script, style
@@ -371,7 +381,7 @@ test('label with no form control', () => {
expect(() => getByLabelText(/alone/)).toThrowErrorMatchingInlineSnapshot(`
Found a label with the text of: /alone/, however no form control was found associated to that label. Make sure you're using the "for" attribute or "aria-labelledby" attribute correctly.
- Ignored nodes: comments, ,
+ Ignored nodes: comments, script, style