Просмотр исходного кода

Merge pull request #6942 from weseek/fix/108856-normalize-vrt

fix: Normalize VRT (20-basic-features/access-to-page.spec.ts/Access to meall-in-app-notifications -- All In-App Notification list is successfully loaded (failed).png)
Shun Miyazawa 3 лет назад
Родитель
Сommit
b13f267698

+ 4 - 2
packages/app/src/components/InAppNotification/InAppNotificationPage.tsx

@@ -64,7 +64,7 @@ export const InAppNotificationPage: FC = () => {
 
     if (notificationData == null) {
       return (
-        <div className="wiki">
+        <div className="wiki" data-testid="grw-in-app-notification-page-spinner">
           <div className="text-muted text-center">
             <i className="fa fa-2x fa-spinner fa-pulse mr-1"></i>
           </div>
@@ -138,7 +138,9 @@ export const InAppNotificationPage: FC = () => {
   };
 
   return (
-    <CustomNavAndContents navTabMapping={navTabMapping} tabContentClasses={['mt-4']} />
+    <div data-testid="grw-in-app-notification-page">
+      <CustomNavAndContents navTabMapping={navTabMapping} tabContentClasses={['mt-4']} />
+    </div>
   );
 };
 

+ 6 - 2
packages/app/test/cypress/integration/20-basic-features/access-to-page.spec.ts

@@ -184,14 +184,18 @@ context('Access to /me/all-in-app-notifications', () => {
     cy.collapseSidebar(true);
   });
 
-  it('All In-App Notification list is successfully loaded', () => {
+  it('All In-App Notification list is successfully loaded', { scrollBehavior: false },() => {
     cy.visit('/');
-    cy.get('.notification-wrapper > a').click();
+    cy.get('.notification-wrapper').click();
     cy.get('.notification-wrapper > .dropdown-menu > a').click();
 
+    cy.getByTestid('grw-in-app-notification-page').should('be.visible');
+    cy.getByTestid('grw-in-app-notification-page-spinner').should('not.exist');
+
     cy.screenshot(`${ssPrefix}-see-all`, { capture: 'viewport' });
 
     cy.get('.grw-custom-nav-tab > div > ul > li:nth-child(2) > a').click();
+    cy.getByTestid('grw-in-app-notification-page-spinner').should('not.exist');
 
     cy.screenshot(`${ssPrefix}-see-unread`, { capture: 'viewport' });
    });