Skip to content

Commit 4e57de4

Browse files
committed
Update tests
1 parent 41e1234 commit 4e57de4

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

src/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class App extends React.Component {
6262
window.history.replaceState(null, '', config.DS_APP_URL);
6363
}
6464

65-
if (config.DS_REDIRECT_AUTHENTICATION) {
65+
if (config?.DS_REDIRECT_AUTHENTICATION) {
6666
const hash = window.location.hash;
6767
if (!hash) {return}
6868
// possible OAuth response

src/App.test.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
import { render, screen } from '@testing-library/react';
22
import App from './App';
3+
import React from 'react';
4+
import ReactDOM from 'react-dom';
35

4-
test('renders learn react link', () => {
6+
test('renders login button', () => {
57
render(<App />);
6-
const linkElement = screen.getByText(/learn react/i);
7-
expect(linkElement).toBeInTheDocument();
8+
const loginEls = screen.getAllByText(/Login/i);
9+
//expect(linkElement).toBeInTheDocument();
10+
expect(loginEls.length).toEqual(2);
811
});
12+
13+
it('renders without crashing', () => {
14+
const div = document.createElement('div');
15+
ReactDOM.render(<App />, div);
16+
ReactDOM.unmountComponentAtNode(div);
17+
});
18+

0 commit comments

Comments
 (0)