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 React from 'react';
test('renders Sodo Search app component', () => {
render(<App />);
const linkElement = screen.getByText(/Sodo Search/i);
expect(linkElement).toBeInTheDocument();
// const containerElement = screen.getElementsByClassName('gh-portal-popup-container');
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';
return (
<div style={Styles.modalContainer}>
<div style={Styles.modalContainer} className='gh-root-frame'>
<Frame style={frameStyle} title="portal-popup" head={this.renderFrameStyles()}>
<div className={className} onClick = {e => this.handlePopupClose(e)}></div>
<PopupContent />
@ -164,10 +164,6 @@ export default class PopupModal extends React.Component {
}
render() {
const {showPopup} = this.context;
if (showPopup) {
return this.renderFrameContainer();
}
return null;
return this.renderFrameContainer();
}
}