Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions e2e/docs/.vuepress/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineClientConfig } from '@vuepress/client'

export default defineClientConfig({
//
})
1 change: 1 addition & 0 deletions e2e/docs/.vuepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export default defineUserConfig({
],
},
],
'/heading-sidebar/': 'heading',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you change the strcture to:

sidebar/
  auto/
  auto.md
  config/
    1.md
    2.md
  README.md

I believe this could be better, thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify, are you suggesting we remove the heading-sidebar folder and replace the sidebar folder with this structure?

Screenshot 2024-01-28 at 9 13 51 AM

Copy link
Member

@Mister-Hope Mister-Hope Jan 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! but a auto folder and a auto.md, auto folder is for theme config, and auto.md is for frontmatter.

This can be done in another pr, and e2e test cases completion welcome.

},
}),
}) as UserConfig
Binary file added e2e/docs/.vuepress/public/favicon.ico
Binary file not shown.
Binary file added e2e/docs/.vuepress/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions e2e/docs/heading-sidebar/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# heading-sidebar

## header 1

## header 2

## header 3
1 change: 1 addition & 0 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"dependencies": {
"@vuepress/bundler-vite": "2.0.0-rc.2",
"@vuepress/bundler-webpack": "2.0.0-rc.2",
"@vuepress/client": "2.0.0-rc.2",
"@vuepress/theme-default": "workspace:*",
"sass": "^1.70.0",
"sass-loader": "^14.0.0",
Expand Down
37 changes: 37 additions & 0 deletions e2e/tests/theme-default/composables/useSidebarItems.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
it("route has 'heading' sidebar", () => {
cy.visit('/heading-sidebar/')
cy.get('.theme-default-content').then((el) => {
cy.wrap(el)
.get('h1')
.invoke('text')
.should('be.not.empty')
.then((text) => {
cy.get('.sidebar-heading')
.invoke('text')
.should('contain', text.replace('#', '').trim())
})
cy.wrap(el)
.get('h2')
.each((header) => {
cy.wrap(header)
.invoke('text')
.should('be.not.empty')
.then((headerText) => {
cy.get('a.sidebar-item').contains(
headerText.replace('#', '').trim(),
)
})
})
})
})

it('route has custom sidebar', () => {
cy.visit('/sidebar/')
cy.get('.theme-default-content').then((el) => {
cy.wrap(el).get('.sidebar-heading').should('contain', 'Sidebar')
cy.wrap(el)
.get('a.sidebar-item')
.should('contain', 'Sidebar Heading 1')
.should('contain', 'Sidebar Heading 2')
})
})
Loading