Fixed App test

This commit is contained in:
Rishabh 2022-07-05 12:21:17 +02:00
parent ca4a3dc8d0
commit 905f4ba964
2 changed files with 6 additions and 9 deletions

View File

@ -1,9 +1,10 @@
import {render, screen} from '@testing-library/react'; import {render} from '@testing-library/react';
import App from './App'; import App from './App';
import React from 'react'; import React from 'react';
test('renders Sodo Search app component', () => { test('renders Sodo Search app component', () => {
render(<App />); render(<App />);
const linkElement = screen.getByText(/Sodo Search/i); // const containerElement = screen.getElementsByClassName('gh-portal-popup-container');
expect(linkElement).toBeInTheDocument(); const containerElement = document.querySelector('.gh-root-frame');
expect(containerElement).toBeInTheDocument();
}); });

View File

@ -154,7 +154,7 @@ export default class PopupModal extends React.Component {
let className = 'gh-portal-popup-background'; let className = 'gh-portal-popup-background';
return ( return (
<div style={Styles.modalContainer}> <div style={Styles.modalContainer} className='gh-root-frame'>
<Frame style={frameStyle} title="portal-popup" head={this.renderFrameStyles()}> <Frame style={frameStyle} title="portal-popup" head={this.renderFrameStyles()}>
<div className={className} onClick = {e => this.handlePopupClose(e)}></div> <div className={className} onClick = {e => this.handlePopupClose(e)}></div>
<PopupContent /> <PopupContent />
@ -164,10 +164,6 @@ export default class PopupModal extends React.Component {
} }
render() { render() {
const {showPopup} = this.context; return this.renderFrameContainer();
if (showPopup) {
return this.renderFrameContainer();
}
return null;
} }
} }