File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 11import { render , screen } from '@testing-library/react' ;
22import 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 ( / l e a r n r e a c t / i) ;
7- expect ( linkElement ) . toBeInTheDocument ( ) ;
8+ const loginEls = screen . getAllByText ( / L o g i n / 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+
You can’t perform that action at this time.
0 commit comments