From 905f4ba9648af7482a6f5598acaac01c79f48e4b Mon Sep 17 00:00:00 2001 From: Rishabh Date: Tue, 5 Jul 2022 12:21:17 +0200 Subject: [PATCH] Fixed App test --- ghost/sodo-search/src/App.test.js | 7 ++++--- ghost/sodo-search/src/components/PopupModal.js | 8 ++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/ghost/sodo-search/src/App.test.js b/ghost/sodo-search/src/App.test.js index f0d2e304fa..07621dde5f 100644 --- a/ghost/sodo-search/src/App.test.js +++ b/ghost/sodo-search/src/App.test.js @@ -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(); - 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(); }); diff --git a/ghost/sodo-search/src/components/PopupModal.js b/ghost/sodo-search/src/components/PopupModal.js index 53e24318d7..cfb370adcd 100644 --- a/ghost/sodo-search/src/components/PopupModal.js +++ b/ghost/sodo-search/src/components/PopupModal.js @@ -154,7 +154,7 @@ export default class PopupModal extends React.Component { let className = 'gh-portal-popup-background'; return ( -
+
this.handlePopupClose(e)}>
@@ -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(); } }