diff --git a/src/__tests__/get-node-text.js b/src/__tests__/get-node-text.js new file mode 100644 index 00000000..d6e91b42 --- /dev/null +++ b/src/__tests__/get-node-text.js @@ -0,0 +1,17 @@ +import {getNodeText} from '../get-node-text' +import {render} from './helpers/test-utils' + +test('it prints out the text content of a container', () => { + const {container} = render('Hello World!') + expect(getNodeText(container)).toMatchInlineSnapshot(`"Hello World!"`) +}) + +test('it prints the value for submit and button inputs', () => { + const {container} = render( + '', + ) + + expect(getNodeText(container.firstChild)).toMatchInlineSnapshot(`"save"`) + + expect(getNodeText(container.lastChild)).toMatchInlineSnapshot(`"reset"`) +})