فهرست منبع

Merge remote-tracking branch 'origin/master' into feat/10814-remark-drawio-plugin

Yuki Takei 3 سال پیش
والد
کامیت
350f36e722

+ 1 - 1
packages/app/src/components/BookmarkButtons.tsx

@@ -63,7 +63,7 @@ const BookmarkButtons: FC<Props> = (props: Props) => {
         <i className={`fa ${isBookmarked ? 'fa-bookmark' : 'fa-bookmark-o'}`}></i>
       </button>
 
-      <UncontrolledTooltip placement="top" target="bookmark-button" fade={false}>
+      <UncontrolledTooltip data-testid="bookmark-button-tooltip" placement="top" target="bookmark-button" fade={false}>
         {t(getTooltipMessage())}
       </UncontrolledTooltip>
 

+ 17 - 2
packages/app/src/components/EventListeneres/HashChanged.tsx

@@ -1,12 +1,15 @@
 import React, { useCallback, useEffect } from 'react';
 
-import { useEditorMode, determineEditorModeByHash } from '~/stores/ui';
+import { useRouter } from 'next/router';
+
 import { useIsEditable } from '~/stores/context';
+import { useEditorMode, determineEditorModeByHash } from '~/stores/ui';
 
 /**
  * Change editorMode by browser forward/back operation
  */
 const HashChanged = (): JSX.Element => {
+  const router = useRouter();
   const { data: isEditable } = useIsEditable();
   const { data: editorMode, mutate: mutateEditorMode } = useEditorMode();
 
@@ -31,7 +34,19 @@ const HashChanged = (): JSX.Element => {
       window.removeEventListener('hashchange', hashchangeHandler);
     };
 
-  }, [hashchangeHandler, isEditable, mutateEditorMode]);
+  }, [hashchangeHandler, isEditable]);
+
+  /*
+  * Route changes by Next Router
+  * https://nextjs.org/docs/api-reference/next/router
+  */
+  useEffect(() => {
+    router.events.on('routeChangeComplete', hashchangeHandler);
+
+    return () => {
+      router.events.off('routeChangeComplete', hashchangeHandler);
+    };
+  }, [hashchangeHandler, router.events]);
 
   return <></>;
 };

+ 1 - 1
packages/app/src/components/LikeButtons.tsx

@@ -56,7 +56,7 @@ const LikeButtons: FC<LikeButtonsProps> = (props: LikeButtonsProps) => {
         <i className={`fa ${isLiked ? 'fa-heart' : 'fa-heart-o'}`}></i>
       </button>
 
-      <UncontrolledTooltip placement="top" target="like-button" fade={false}>
+      <UncontrolledTooltip data-testid="like-button-tooltip" placement="top" target="like-button" autohide={false} fade={false}>
         {t(getTooltipMessage())}
       </UncontrolledTooltip>
 

+ 22 - 4
packages/app/src/components/PageEditor.tsx

@@ -4,7 +4,9 @@ import React, {
 
 import EventEmitter from 'events';
 
-import { envUtils, IPageHasId, PageGrant } from '@growi/core';
+import {
+  envUtils, IPageHasId, PageGrant, pathUtils,
+} from '@growi/core';
 import detectIndent from 'detect-indent';
 import { useTranslation } from 'next-i18next';
 import { useRouter } from 'next/router';
@@ -16,7 +18,7 @@ import { apiGet, apiPostForm } from '~/client/util/apiv1-client';
 import { getOptionsToSave } from '~/client/util/editor';
 import { IEditorMethods } from '~/interfaces/editor-methods';
 import {
-  useCurrentPathname, useCurrentPageId,
+  useCurrentPathname, useCurrentPageId, useIsEnabledAttachTitleHeader, useTemplateBodyData,
   useIsEditable, useIsIndentSizeForced, useIsUploadableFile, useIsUploadableImage, useEditingMarkdown, useIsNotFound,
 } from '~/stores/context';
 import {
@@ -62,6 +64,8 @@ const PageEditor = React.memo((): JSX.Element => {
   const { data: grantData, mutate: mutateGrant } = useSelectedGrant();
   const { data: pageTags } = usePageTagsForEditors(pageId);
   const { data: editingMarkdown } = useEditingMarkdown();
+  const { data: isEnabledAttachTitleHeader } = useIsEnabledAttachTitleHeader();
+  const { data: templateBodyData } = useTemplateBodyData();
   const { data: isEditable } = useIsEditable();
   const { data: editorMode, mutate: mutateEditorMode } = useEditorMode();
   const { data: isMobile } = useIsMobile();
@@ -77,14 +81,28 @@ const PageEditor = React.memo((): JSX.Element => {
   const { data: rendererOptions } = usePreviewOptions();
 
   const currentRevisionId = currentPage?.revision?._id;
-  const initialValue = editingMarkdown ?? '';
+
+  const initialValue = useMemo(() => {
+    if (!isNotFound) {
+      return editingMarkdown ?? '';
+    }
+
+    let initialValue = '';
+    if (isEnabledAttachTitleHeader && currentPathname != null) {
+      initialValue += `${pathUtils.attachTitleHeader(currentPathname)}\n`;
+    }
+    if (templateBodyData != null) {
+      initialValue += `${templateBodyData}\n`;
+    }
+    return initialValue;
+
+  }, [isNotFound, currentPathname, editingMarkdown, isEnabledAttachTitleHeader, templateBodyData]);
 
   const markdownToSave = useRef<string>(initialValue);
   const [markdownToPreview, setMarkdownToPreview] = useState<string>(initialValue);
 
   const slackChannels = useMemo(() => (slackChannelsData ? slackChannelsData.toString() : ''), [slackChannelsData]);
 
-
   const editorRef = useRef<IEditorMethods>(null);
   const previewRef = useRef<HTMLDivElement>(null);
 

+ 4 - 2
packages/app/src/components/PageEditor/CodeMirrorEditor.jsx

@@ -131,8 +131,10 @@ class CodeMirrorEditor extends AbstractEditor {
     this.handleCtrlEnterKey = this.handleCtrlEnterKey.bind(this);
 
     this.scrollCursorIntoViewHandler = this.scrollCursorIntoViewHandler.bind(this);
+    this.scrollCursorIntoViewHandlerThrottled = throttle(500, this.scrollCursorIntoViewHandler);
     this.pasteHandler = this.pasteHandler.bind(this);
     this.cursorHandler = this.cursorHandler.bind(this);
+    this.cursorHandlerDebounced = debounce(200, throttle(500, this.cursorHandler));
     this.changeHandler = this.changeHandler.bind(this);
     this.turnOnEmojiPickerMode = this.turnOnEmojiPickerMode.bind(this);
     this.turnOffEmojiPickerMode = this.turnOffEmojiPickerMode.bind(this);
@@ -1091,7 +1093,7 @@ class CodeMirrorEditor extends AbstractEditor {
             },
             lint,
           }}
-          onCursor={this.cursorHandler}
+          onCursor={this.cursorHandlerDebounced}
           onScroll={(editor, data) => {
             if (this.props.onScroll != null) {
             // add line data
@@ -1109,7 +1111,7 @@ class CodeMirrorEditor extends AbstractEditor {
           onKeyPress={this.keyPressHandler}
           onKeyDown={this.keyDownHandler}
           onPasteFiles={this.pasteHandler}
-          onScrollCursorIntoView={this.scrollCursorIntoViewHandler}
+          onScrollCursorIntoView={this.scrollCursorIntoViewHandlerThrottled}
         />
 
         { this.renderLoadingKeymapOverlay() }

+ 1 - 1
packages/app/src/components/SubscribeButton.tsx

@@ -42,7 +42,7 @@ const SubscribeButton: FC<Props> = (props: Props) => {
         <i className={`fa ${isSubscribing ? 'fa-bell' : 'fa-bell-slash-o'}`}></i>
       </button>
 
-      <UncontrolledTooltip placement="top" target="subscribe-button" fade={false}>
+      <UncontrolledTooltip data-testid="subscribe-button-tooltip" placement="top" target="subscribe-button" fade={false}>
         {t(getTooltipMessage())}
       </UncontrolledTooltip>
     </>

+ 1 - 1
packages/app/src/components/User/SeenUserInfo.tsx

@@ -41,7 +41,7 @@ const SeenUserInfo: FC<Props> = (props: Props) => {
           </div>
         </PopoverBody>
       </Popover>
-      <UncontrolledTooltip placement="top" target="btn-seen-user" fade={false}>
+      <UncontrolledTooltip data-testid="seen-user-info-tooltip" placement="top" target="btn-seen-user" fade={false}>
         {t('tooltip.footprints')}
       </UncontrolledTooltip>
     </div>

+ 8 - 3
packages/app/src/pages/[[...path]].page.tsx

@@ -63,7 +63,7 @@ import {
   useIsEnabledStaleNotification, useIsIdenticalPath,
   useIsSearchServiceConfigured, useIsSearchServiceReachable, useDisableLinkSharing,
   useDrawioUri, useHackmdUri, useDefaultIndentSize, useIsIndentSizeForced,
-  useIsAclEnabled, useIsSearchPage, useTemplateTagData,
+  useIsAclEnabled, useIsSearchPage, useTemplateTagData, useTemplateBodyData, useIsEnabledAttachTitleHeader,
   useCsrfToken, useIsSearchScopeChildrenAsDefault, useCurrentPageId, useCurrentPathname,
   useIsSlackConfigured, useRendererConfig, useEditingMarkdown,
   useEditorConfig, useIsAllReplyShown, useIsUploadableFile, useIsUploadableImage, useCustomizedLogoSrc, useIsContainerFluid,
@@ -163,6 +163,7 @@ type Props = CommonProps & {
   isContainerFluid: boolean,
   editorConfig: EditorConfig,
   isEnabledStaleNotification: boolean,
+  isEnabledAttachTitleHeader: boolean,
   // isEnabledLinebreaks: boolean,
   // isEnabledLinebreaksInComments: boolean,
   adminPreferredIndentSize: number,
@@ -217,7 +218,9 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
   useIsSearchPage(false);
 
   useTemplateTagData(props.templateTagData);
+  useTemplateBodyData(props.templateBodyData);
 
+  useIsEnabledAttachTitleHeader(props.isEnabledAttachTitleHeader);
   useIsSearchServiceConfigured(props.isSearchServiceConfigured);
   useIsSearchServiceReachable(props.isSearchServiceReachable);
   useIsSearchScopeChildrenAsDefault(props.isSearchScopeChildrenAsDefault);
@@ -250,7 +253,8 @@ const GrowiPage: NextPage<Props> = (props: Props) => {
   useCurrentPathname(props.currentPathname);
 
   const { data: currentPage } = useSWRxCurrentPage(undefined, pageWithMeta?.data ?? null); // store initial data
-  useEditingMarkdown(pageWithMeta?.data.revision?.body ?? props.templateBodyData ?? '');
+
+  useEditingMarkdown(pageWithMeta?.data.revision?.body);
 
   const { data: grantData } = useSWRxIsGrantNormalized(pageId);
   const { mutate: mutateSelectedGrant } = useSelectedGrant();
@@ -474,7 +478,6 @@ async function injectRoutingInformation(context: GetServerSidePropsContext, prop
   }
   else {
     props.isNotFound = page.isEmpty;
-
     // /62a88db47fed8b2d94f30000 ==> /path/to/page
     if (isPermalink && page.isEmpty) {
       props.currentPathname = page.path;
@@ -538,6 +541,8 @@ function injectServerConfigurations(context: GetServerSidePropsContext, props: P
   props.adminPreferredIndentSize = configManager.getConfig('markdown', 'markdown:adminPreferredIndentSize');
   props.isIndentSizeForced = configManager.getConfig('markdown', 'markdown:isIndentSizeForced');
 
+  props.isEnabledAttachTitleHeader = configManager.getConfig('crowi', 'customize:isEnabledAttachTitleHeader');
+
   props.rendererConfig = {
     isEnabledLinebreaks: configManager.getConfig('markdown', 'markdown:isEnabledLinebreaks'),
     isEnabledLinebreaksInComments: configManager.getConfig('markdown', 'markdown:isEnabledLinebreaksInComments'),

+ 6 - 5
packages/app/src/stores/context.tsx

@@ -1,12 +1,9 @@
-import { IUser, pagePathUtils } from '@growi/core';
-import { HtmlElementNode } from 'rehype-toc';
-import { Key, SWRResponse, useSWRConfig } from 'swr';
+import { IUser } from '@growi/core';
+import { Key, SWRResponse } from 'swr';
 import useSWRImmutable from 'swr/immutable';
 
-
 import { SupportedActionType } from '~/interfaces/activity';
 import { EditorConfig } from '~/interfaces/editor-settings';
-// import { CustomWindow } from '~/interfaces/global';
 import { RendererConfig } from '~/interfaces/services/renderer';
 import { GrowiThemes } from '~/interfaces/theme';
 import InterceptorManager from '~/services/interceptor-manager';
@@ -72,6 +69,10 @@ export const useTemplateTagData = (initialData?: string[]): SWRResponse<string[]
   return useContextSWR<string[], Error>('templateTagData', initialData);
 };
 
+export const useTemplateBodyData = (initialData?: string): SWRResponse<string, Error> => {
+  return useContextSWR<string, Error>('templateBodyData', initialData);
+};
+
 export const useIsSharedUser = (initialData?: boolean): SWRResponse<boolean, Error> => {
   return useContextSWR<boolean, Error>('isSharedUser', initialData);
 };

+ 14 - 5
packages/app/src/stores/ui.tsx

@@ -96,18 +96,27 @@ const getClassNamesByEditorMode = (editorMode: EditorMode | undefined, isSidebar
   return classNames;
 };
 
+export const EditorModeHash = {
+  View: '',
+  Edit: '#edit',
+  HackMD: '#hackmd',
+} as const;
+export type EditorModeHash = typeof EditorModeHash[keyof typeof EditorModeHash];
+
+export const isEditorModeHash = (hash: string): hash is EditorModeHash => Object.values<string>(EditorModeHash).includes(hash);
+
 const updateHashByEditorMode = (newEditorMode: EditorMode) => {
   const { pathname, search } = window.location;
 
   switch (newEditorMode) {
     case EditorMode.View:
-      window.history.replaceState(null, '', `${pathname}${search}`);
+      window.history.replaceState(null, '', `${pathname}${search}${EditorModeHash.View}`);
       break;
     case EditorMode.Editor:
-      window.history.replaceState(null, '', `${pathname}${search}#edit`);
+      window.history.replaceState(null, '', `${pathname}${search}${EditorModeHash.Edit}`);
       break;
     case EditorMode.HackMD:
-      window.history.replaceState(null, '', `${pathname}${search}#hackmd`);
+      window.history.replaceState(null, '', `${pathname}${search}${EditorModeHash.HackMD}`);
       break;
   }
 };
@@ -120,9 +129,9 @@ export const determineEditorModeByHash = (): EditorMode => {
   const { hash } = window.location;
 
   switch (hash) {
-    case '#edit':
+    case EditorModeHash.Edit:
       return EditorMode.Editor;
-    case '#hackmd':
+    case EditorModeHash.HackMD:
       return EditorMode.HackMD;
     default:
       return EditorMode.View;

+ 11 - 1
packages/app/test/cypress/integration/20-basic-features/access-to-pagelist.spec.ts

@@ -11,8 +11,18 @@ context('Access to pagelist', () => {
 
   it('Page list modal is successfully opened ', () => {
     cy.visit('/');
+    cy.waitUntilSkeletonDisappear();
+
     cy.getByTestid('pageListButton').click({force: true});
-    cy.getByTestid('page-accessories-modal').should('be.visible').screenshot(`${ssPrefix}1-open-pagelist-modal`);
+    cy.getByTestid('page-accessories-modal').parent().should('have.class','show');
+    cy.getByTestid('page-list-item-L').should('be.visible');
+
+    // Wait until the string "You cannot see this page" is no longer displayed
+    cy.getByTestid('page-list-item-L').eq(0).within(() => {
+      cy.get('.icon-exclamation').should('not.exist');
+    });
+
+    cy.screenshot(`${ssPrefix}1-open-pagelist-modal`);
   });
 
   it('Successfully duplicate a page from page list', () => {

+ 121 - 59
packages/app/test/cypress/integration/20-basic-features/click-page-icons.spec.ts

@@ -12,83 +12,145 @@ context('Click page icons button', () => {
 
   it('Successfully subscribe/unsubscribe a page', () => {
     cy.visit('/Sandbox');
-    cy.get('#grw-subnav-container').within(() => {
-      // Subscribe
-      cy.get('#subscribe-button').click({force: true});
-      cy.get('#subscribe-button').should('have.class', 'active');
-      cy.screenshot(`${ssPrefix}1-subscribe-page`);
-
-      // Unsubscribe
-      cy.get('#subscribe-button.active').click({force: true});
-      cy.get('#subscribe-button').should('not.have.class', 'active');
-      cy.screenshot(`${ssPrefix}2-unsubscribe-page`);
-    });
+    cy.waitUntilSkeletonDisappear();
+
+    // Subscribe
+    cy.get('#subscribe-button').click({force: true});
+    cy.get('#subscribe-button').should('have.class', 'active');
+
+    // position of the element is not fixed to be displayed, so the element is removed
+    cy.get('body').then($body => {
+      if ($body.find('[data-testid="subscribe-button-tooltip"]').length > 0) {
+        cy.getByTestid('subscribe-button-tooltip').invoke('remove');
+      }
+    })
+    cy.getByTestid('subscribe-button-tooltip').should('not.exist');
+
+    cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}1-subscribe-page`) })
+
+    // Unsubscribe
+    cy.get('#subscribe-button').click({force: true});
+    cy.get('#subscribe-button').should('not.have.class', 'active');
+
+    // position of the element is not fixed to be displayed, so the element is removed
+    cy.get('body').then($body => {
+      if ($body.find('[data-testid="subscribe-button-tooltip"]').length > 0) {
+        cy.getByTestid('subscribe-button-tooltip').invoke('remove');
+      }
+    })
+    cy.getByTestid('subscribe-button-tooltip').should('not.exist');
+
+    cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}2-unsubscribe-page`) })
   });
 
   it('Successfully Like / Dislike a page', () => {
     cy.visit('/Sandbox');
-    cy.get('#grw-subnav-container').within(() => {
-      cy.get('#like-button').click({force: true});
-      cy.get('#like-button').should('have.class', 'active');
-      cy.screenshot(`${ssPrefix}3-like-page`);
-      cy.get('#po-total-likes').click({force: true});
-    });
-    cy.get('.user-list-popover').should('be.visible');
+    cy.waitUntilSkeletonDisappear();
 
-    cy.get('#grw-subnav-container').within(() => {
-      cy.screenshot(`${ssPrefix}4-likes-counter`);
-      cy.get('#like-button.active').click({force: true});
-      cy.get('#like-button').should('not.have.class', 'active');
-      cy.screenshot(`${ssPrefix}5-dislike-page`);
-      cy.get('#po-total-likes').click({force: true});
-    });
+    // like
+    cy.get('#like-button').click({force: true});
+    cy.get('#like-button').should('have.class', 'active');
 
-    cy.get('.user-list-popover').should('be.visible');
+    // position of the element is not fixed to be displayed, so the element is removed
+    cy.get('body').then($body => {
+      if ($body.find('[data-testid="like-button-tooltip"]').length > 0) {
+        cy.getByTestid('like-button-tooltip').invoke('remove');
+      }
+    })
+    cy.getByTestid('like-button-tooltip').should('not.exist');
 
-    cy.get('#grw-subnav-container').within(() => {
-      cy.screenshot(`${ssPrefix}6-likes-counter`);
-    });
+    cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}3-like-page`) });
+
+    // total liker (user-list-popover is commented out because it is sometimes displayed and sometimes not.)
+    // cy.get('#po-total-likes').click({force: true});
+    // cy.get('.user-list-popover').should('be.visible')
+    // cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}4-likes-counter`) });
+
+    // unlike
+    cy.get('#like-button').click({force: true});
+    cy.get('#like-button').should('not.have.class', 'active');
+
+    // position of the element is not fixed to be displayed, so the element is removed
+    cy.get('body').then($body => {
+      if ($body.find('[data-testid="like-button-tooltip"]').length > 0) {
+        cy.getByTestid('like-button-tooltip').invoke('remove');
+      }
+    })
+    cy.getByTestid('like-button-tooltip').should('not.exist');
+
+    cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}5-dislike-page`) });
+
+    // total liker (user-list-popover is commented out because it is sometimes displayed and sometimes not.)
+    // cy.get('#po-total-likes').click({force: true});
+    // cy.get('.user-list-popover').should('be.visible');
+    // cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}6-likes-counter`) });
   });
 
   it('Successfully Bookmark / Unbookmark a page', () => {
     cy.visit('/Sandbox');
-    cy.get('#grw-subnav-container').within(() => {
-      cy.get('#bookmark-button').click({force: true});
-      cy.get('#bookmark-button').should('have.class', 'active');
-      cy.screenshot(`${ssPrefix}7-bookmark-page`);
-      cy.get('#po-total-bookmarks').click({force: true});
-    });
-    cy.get('.user-list-popover').should('be.visible');
+    cy.waitUntilSkeletonDisappear();
 
-    cy.get('#grw-subnav-container').within(() => {
-      cy.screenshot(`${ssPrefix}8-bookmarks-counter`);
-      cy.get('#bookmark-button.active').click({force: true});
-      cy.get('#bookmark-button').should('not.have.class', 'active');
-      cy.screenshot(`${ssPrefix}9-unbookmark-page`);
-      cy.get('#po-total-bookmarks').click({force: true});
-    });
+    // bookmark
+    cy.get('#bookmark-button').click({force: true});
+    cy.get('#bookmark-button').should('have.class', 'active');
+
+    // position of the element is not fixed to be displayed, so the element is removed
+    cy.get('body').then($body => {
+      if ($body.find('[data-testid="bookmark-button-tooltip"]').length > 0) {
+        cy.getByTestid('bookmark-button-tooltip').invoke('remove');
+      }
+    })
+    cy.getByTestid('bookmark-button-tooltip').should('not.exist');
 
+    cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}7-bookmark-page`) });
+
+    // total bookmarker
+    cy.get('#po-total-bookmarks').click({force: true});
     cy.get('.user-list-popover').should('be.visible');
+    cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}8-bookmarks-counter`) });
 
-    cy.get('#grw-subnav-container').within(() => {
-      cy.screenshot(`${ssPrefix}10-bookmarks-counter`);
-    });
-  });
+    // unbookmark
+    cy.get('#bookmark-button').click({force: true});
+    cy.get('#bookmark-button').should('not.have.class', 'active');
 
-  it('Successfully display list of "seen by user"', () => {
-    cy.visit('/Sandbox');
-    cy.waitUntilSkeletonDisappear();
-    // eslint-disable-next-line cypress/no-unnecessary-waiting
-    cy.wait(2000); // wait for get method
-    cy.get('#grw-subnav-container').within(() => {
-      cy.get('div.grw-seen-user-info').find('button#btn-seen-user').click({force: true});
-    });
+    // position of the element is not fixed to be displayed, so the element is removed
+    cy.get('body').then($body => {
+      if ($body.find('[data-testid="bookmark-button-tooltip"]').length > 0) {
+        cy.getByTestid('bookmark-button-tooltip').invoke('remove');
+      }
+    })
+    cy.getByTestid('bookmark-button-tooltip').should('not.exist');
 
-    cy.get('.user-list-popover').should('be.visible')
+    cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}9-unbookmark-page`) });
 
-    cy.get('#grw-subnav-container').within(() => {
-      cy.screenshot(`${ssPrefix}11-seen-user-list`);
-    });
+    // total bookmarker
+    cy.get('#po-total-bookmarks').click({force: true});
+    cy.get('.user-list-popover').should('be.visible');
+    cy.get('#grw-subnav-container').within(() => { cy.screenshot(`${ssPrefix}10-bookmarks-counter`) });
   });
 
+  // user-list-popover is commented out because it is sometimes displayed and sometimes not
+  // it('Successfully display list of "seen by user"', () => {
+  //   cy.visit('/Sandbox');
+  //   cy.waitUntilSkeletonDisappear();
+
+  //   cy.get('#grw-subnav-container').within(() => {
+  //     cy.get('div.grw-seen-user-info').find('button#btn-seen-user').click({force: true});
+  //   });
+
+  //   // position of the element is not fixed to be displayed, so the element is removed
+  //   cy.get('body').then($body => {
+  //     if ($body.find('[data-testid="seen-user-info-tooltip"]').length > 0) {
+  //       cy.getByTestid('seen-user-info-tooltip').invoke('remove');
+  //     }
+  //   })
+  //   cy.getByTestid('seen-user-info-tooltip').should('not.exist');
+
+  //   cy.get('.user-list-popover').should('be.visible')
+
+  //   cy.get('#grw-subnav-container').within(() => {
+  //     cy.screenshot(`${ssPrefix}11-seen-user-list`);
+  //   });
+  // });
+
 });

+ 2 - 0
packages/app/test/cypress/integration/40-admin/access-to-admin-page.spec.ts

@@ -39,6 +39,8 @@ context('Access to Admin page', () => {
   it('/admin/security is successfully loaded', () => {
     cy.visit('/admin/security');
     cy.getByTestid('admin-security').should('be.visible');
+    cy.get('#isShowRestrictedByOwner').should('be.checked')
+    cy.get('#isShowRestrictedByGroup').should('be.checked')
     cy.screenshot(`${ssPrefix}-admin-security`);
   });