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

feat: vrt tag

https://youtrack.weseek.co.jp/issue/GW-7740
- Add spec.ts for vrt tag
- Add data-testid props in Render tags label
I Komang Mudana 4 лет назад
Родитель
Сommit
5b04b2a36b

+ 1 - 0
packages/app/src/components/Page/RenderTagLabels.tsx

@@ -37,6 +37,7 @@ const RenderTagLabels = React.memo((props: RenderTagLabelsProps) => {
         <a
           className={`btn btn-link btn-edit-tags p-0 text-muted ${isTagsEmpty ? 'no-tags' : ''} ${isGuestUser ? 'disabled' : ''}`}
           onClick={openEditorHandler}
+          data-tesid="open-tag-editor"
         >
           { isTagsEmpty && <>{ t('Add tags for this page') }</>}
           <i className="ml-1 icon-plus"></i>

+ 35 - 0
packages/app/test/cypress/integration/7-tag/add-tag.spec.ts

@@ -0,0 +1,35 @@
+/* eslint-disable cypress/no-unnecessary-waiting */
+context('Tag', () => {
+  const ssPrefix = 'tag-';
+
+  let connectSid: string | undefined;
+
+  before(() => {
+    // login
+    cy.fixture("user-admin.json").then(user => {
+      cy.login(user.username, user.password);
+    });
+    cy.getCookie('connect.sid').then(cookie => {
+      connectSid = cookie?.value;
+    });
+  });
+
+  beforeEach(() => {
+    if (connectSid != null) {
+      cy.setCookie('connect.sid', connectSid);
+    }
+  });
+
+  it('Add Tag', () => {
+    const tag = 'we';
+    cy.visit('/');
+    cy.getByTestid('open-tag-editor').click();
+    cy.wait(1000);
+    cy.screenshot(`${ssPrefix}click-add-tag`, {capture: 'viewport'});
+
+    // cy.get('#edit-tag-modal > div.rbt-input > input').type(tag);
+    // cy.screenshot('tag input ', {capture: 'viewport'});
+
+  });
+
+});