Skip to content

Commit 23866f1

Browse files
committed
update jest test descriptions
1 parent de4d34b commit 23866f1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/react-on-rails/tests/pageLifecycle.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,20 +77,20 @@ describe('pageLifecycle', () => {
7777

7878
// Since no navigation library is mocked, callbacks should run immediately
7979
expect(callback).toHaveBeenCalledTimes(1);
80-
// Should not add DOMContentLoaded listener since readyState is not 'loading'
80+
// Should not add readystatechange listener since readyState is not 'loading'
8181
expect(addEventListenerSpy).not.toHaveBeenCalledWith('readystatechange', expect.any(Function));
8282
});
8383

8484
it('should wait for readystatechange when document.readyState is "interactive"', () => {
85-
setReadyState('loading');
85+
setReadyState('interactive');
8686
const callback = jest.fn();
8787
const { onPageLoaded } = importPageLifecycle();
8888

8989
onPageLoaded(callback);
9090

9191
// Should not call callback immediately since readyState is 'loading'
9292
expect(callback).not.toHaveBeenCalled();
93-
// Verify that a DOMContentLoaded listener was added when readyState is 'loading'
93+
// Verify that a readystatechange listener was added when readyState is 'loading'
9494
expect(addEventListenerSpy).toHaveBeenCalledWith('readystatechange', expect.any(Function));
9595
});
9696

@@ -103,7 +103,7 @@ describe('pageLifecycle', () => {
103103

104104
// Should not call callback immediately since readyState is 'loading'
105105
expect(callback).not.toHaveBeenCalled();
106-
// Verify that a DOMContentLoaded listener was added when readyState is 'loading'
106+
// Verify that a readystatechange listener was added when readyState is 'loading'
107107
expect(addEventListenerSpy).toHaveBeenCalledWith('readystatechange', expect.any(Function));
108108
});
109109

0 commit comments

Comments
 (0)