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
2 changes: 1 addition & 1 deletion assets/sass/sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ aside.sidebar.active {
background-color: $black-3 !important;
display: block;
position: fixed;
padding: 2rem 0.4rem;
padding: 2rem 0rem;
z-index: 1;
border: none;
left: 0;
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/sidebar.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ $section := .Scratch.Get "section" }}
<button class="sidebar-btn"></button>
<div tabindex="1" class="sidebar-btn"></div>
<aside class="sidebar" id="sidebar">
<nav>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "This is the Git home page.",
"license": "MIT",
"devDependencies": {
"@playwright/test": "^1.47.0",
"@playwright/test": "^1.47.2",
"@types/node": "^22.5.4"
}
}
7 changes: 7 additions & 0 deletions playwright.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,13 @@ module.exports = defineConfig({
name: 'chrome',
use: { ...devices['Desktop Chrome'], channel: 'chrome' },
},
{
name: 'iPhone',
use: {
...devices['iPhone 11'],
},
},


/* Test against mobile viewports. */
// {
Expand Down
16 changes: 16 additions & 0 deletions tests/git-scm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,3 +265,19 @@ test('404', async ({ page }) => {
// the usual navbar is shown
await expect(page.getByRole('link', { name: 'Community' })).toBeVisible()
})

test('sidebar', async ({ page }) => {
await page.goto(`${url}community`);

test.skip(!await page.evaluate(() => matchMedia('(max-width: 940px)').matches),
'not a small screen');

const sidebarButton = page.locator('.sidebar-btn');
await expect(sidebarButton).toBeVisible();
await sidebarButton.click();

const about = page.getByRole('link', { name: 'About', exact: true });
await expect(about).toBeVisible();
await about.click();
await expect(page.getByRole('heading', { name: 'About - Branching and Merging' })).toBeVisible();
});
Loading