Yuki Takei 4 лет назад
Родитель
Сommit
1a57305de7

+ 1 - 1
packages/app/src/components/SearchPage/SearchResultContent.tsx

@@ -153,7 +153,7 @@ export const SearchResultContent: FC<Props> = (props: Props) => {
   if (page == null) return <></>;
 
   return (
-    <div key={page._id} className="search-result-content grw-page-path-text-muted-container d-flex flex-column">
+    <div key={page._id} data-testid="search-result-content" className="search-result-content grw-page-path-text-muted-container d-flex flex-column">
       <div className="grw-subnav-append-shadow-container">
         <GrowiSubNavigation
           page={page}

+ 1 - 1
packages/app/src/components/SearchPage/SearchResultList.tsx

@@ -79,7 +79,7 @@ const SearchResultListSubstance: ForwardRefRenderFunction<ISelectableAll, Props>
   }
 
   return (
-    <ul className="page-list-ul list-group list-group-flush">
+    <ul data-testid="search-result-list" className="page-list-ul list-group list-group-flush">
       { (injectedPage ?? pages).map((page, i) => {
         return (
           <PageListItemL

+ 1 - 1
packages/app/src/components/SearchPage2/SearchPageBase.tsx

@@ -107,7 +107,7 @@ const SearchPageBaseSubstance: ForwardRefRenderFunction<ISelectableAll, Props> =
 
   return (
     <div className="content-main">
-      <div className="search-result-base d-flex">
+      <div className="search-result-base d-flex" data-testid="search-result-base">
 
         <div className="mw-0 flex-grow-1 flex-basis-0 border boder-gray search-result-list" id="search-result-list">
 

+ 7 - 2
packages/app/test/cypress/integration/3-search/access-to-result-page-directly.spec.ts

@@ -21,14 +21,19 @@ context('Access to search result page directly', () => {
 
   it('/_search with "q" param is successfully loaded', () => {
     cy.visit('/_search', { qs: { q: 'bootstrap4' } });
-    // eslint-disable-next-line cypress/no-unnecessary-waiting
-    cy.wait(1000);
+
+    cy.getByTestid('search-result-list').should('be.visible');
+    cy.getByTestid('search-result-content').should('be.visible');
+
     cy.screenshot(`${ssPrefix}-with-q`, { capture: 'viewport' });
   });
 
   it('checkboxes behaviors', () => {
     cy.visit('/_search', { qs: { q: 'bootstrap4' } });
 
+    cy.getByTestid('search-result-base').should('be.visible');
+    cy.getByTestid('search-result-list').should('be.visible');
+
     cy.getByTestid('cb-select').first().click({force: true});
     cy.screenshot(`${ssPrefix}-the-first-checkbox-on`, { capture: 'viewport' });
     cy.getByTestid('cb-select').first().click({force: true});