Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持 Markdown 内的代码折叠功能 #3842

Open
4 tasks done
linpengteng opened this issue Apr 29, 2024 · 0 comments
Open
4 tasks done

支持 Markdown 内的代码折叠功能 #3842

linpengteng opened this issue Apr 29, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@linpengteng
Copy link

linpengteng commented Apr 29, 2024

Is your feature request related to a problem? Please describe.

如下代码,支持 it('xxxxxx', () => { /* code */}) 代码折叠

```typescript:line-numbers [范例]
import Login from "@/views/auth/Login.vue";

describe("Vue Component", () => {
  it("挂载渲染 - Login 组件", () => {
    cy.mount(Login);
  });

  it("模拟触发 - Input 校验", () => {
    cy.mount(Login);

    cy.get('input[type="text"]').as("usernameInput");
    cy.get('input[type="password"]').as("passwordInput");

    cy.get("@usernameInput").type("admin");
    cy.get("@passwordInput").type("password");

    cy.get("@usernameInput").should("have.value", "admin");
    cy.get("@passwordInput").should("have.value", "password");
  });
});
```

Describe the solution you'd like

通过 // [!code collapse:<+/-lines>] 支持代码折叠 (其中,lines 可折叠部分的行数,+line -> 默认展开, -line 默认已折叠)

```typescript:line-numbers [范例]
import Login from "@/views/auth/Login.vue";

describe("Vue Component", () => {
  it("挂载渲染 - Login 组件", () => {  // [!code collapse:3]
    cy.mount(Login);
  });

  it("模拟触发 - Input 校验", () => {   // [!code collapse:-12]
    cy.mount(Login);

    cy.get('input[type="text"]').as("usernameInput");
    cy.get('input[type="password"]').as("passwordInput");

    cy.get("@usernameInput").type("admin");
    cy.get("@passwordInput").type("password");

    cy.get("@usernameInput").should("have.value", "admin");
    cy.get("@passwordInput").should("have.value", "password");
  });
});
```

Describe alternatives you've considered

No response

Additional context

No response

Validations

@brc-dd brc-dd added the enhancement New feature or request label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants