Skip to content

Commit 2bf568a

Browse files
pamuchenickserv
andauthored
Refer to Ada Lovelace as a programmer (#713)
* Maybe Ada isn't just a woman also a programmer Maybe Ada isn't just famous for beeing a woman than being the first Programmer :) Thank you for this nice human-like testing library. Kudos * Also refer to Ada Lovelace as a programmer in React Native example Co-authored-by: Nick McCurdy <nick@nickmccurdy.com>
1 parent d073cca commit 2bf568a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/dom-testing-library/example-intro.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ function getExampleDOM() {
4646
}
4747

4848
test('examples of some things', async () => {
49-
const famousWomanInHistory = 'Ada Lovelace'
49+
const famousProgrammerInHistory = 'Ada Lovelace'
5050
const container = getExampleDOM()
5151

5252
// Get form elements by their label text.
5353
// An error will be thrown if one cannot be found (accessibility FTW!)
5454
const input = getByLabelText(container, 'Username')
55-
input.value = famousWomanInHistory
55+
input.value = famousProgrammerInHistory
5656

5757
// Get elements by their text, just like a real user does.
5858
getByText(container, 'Print Username').click()
@@ -64,7 +64,7 @@ test('examples of some things', async () => {
6464
// getByTestId and queryByTestId are an escape hatch to get elements
6565
// by a test id (could also attempt to get this element by its text)
6666
expect(getByTestId(container, 'printed-username')).toHaveTextContent(
67-
famousWomanInHistory
67+
famousProgrammerInHistory
6868
)
6969
// jest snapshots work great with regular DOM nodes!
7070
expect(container).toMatchSnapshot()

docs/react-native-testing-library/example-intro.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,18 @@ function Example() {
3333

3434
test('examples of some things', async () => {
3535
const { getByTestId, getByText, queryByTestId, toJSON } = render(<Example />)
36-
const famousWomanInHistory = 'Ada Lovelace'
36+
const famousProgrammerInHistory = 'Ada Lovelace'
3737

3838
const input = getByTestId('input')
39-
fireEvent.changeText(input, famousWomanInHistory)
39+
fireEvent.changeText(input, famousProgrammerInHistory)
4040

4141
const button = getByText('Print Username')
4242
fireEvent.press(button)
4343

4444
await waitFor(() => expect(queryByTestId('printed-username')).toBeTruthy())
4545

4646
expect(getByTestId('printed-username').props.children).toBe(
47-
famousWomanInHistory
47+
famousProgrammerInHistory
4848
)
4949
expect(toJSON()).toMatchSnapshot()
5050
})

0 commit comments

Comments
 (0)