Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Sep 11, 2022
1 parent 874b9a3 commit 994779a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion docs/src/modules/components/DemoToolbar.js
Expand Up @@ -404,7 +404,7 @@ export default function DemoToolbar(props) {
data-ga-event-label={demoOptions.demo}
data-ga-event-action="link-deploy-preview"
component="a"
href={`https://deploy-preview-${PULL_REQUEST_ID}--${process.env.NETLIFY_SITE_NAME}.netlify.app${router.route}/#${demoName}`}
href={`https://deploy-preview-${process.env.PULL_REQUEST_ID}--${process.env.NETLIFY_SITE_NAME}.netlify.app${router.route}/#${demoName}`}
target="_blank"
rel="noopener nofollow"
onClick={handleMoreClose}
Expand Down
42 changes: 21 additions & 21 deletions test/e2e-website/material-docs.spec.ts
Expand Up @@ -7,7 +7,7 @@ const test = base.extend<TestFixture>({});

test.describe('Material docs', () => {
test('should have correct link with hash in the TOC', async ({ page }) => {
await page.goto(`/material-ui/getting-started/installation/`);
await page.goto('/material-ui/getting-started/installation/');

const anchors = page.locator('[aria-label="Page table of contents"] ul a');

Expand All @@ -25,7 +25,7 @@ test.describe('Material docs', () => {
(process.env.CIRCLE_BRANCH || '').startsWith('pull'),
'There is no languages on the deploy preview',
);
await page.goto(`/zh/material-ui/getting-started/installation/`);
await page.goto('/zh/material-ui/getting-started/installation/');

const anchors = page.locator('main nav ul a');

Expand All @@ -40,7 +40,7 @@ test.describe('Material docs', () => {

test.describe('Demo page', () => {
test('should have correct link for API section', async ({ page }) => {
await page.goto(`/material-ui/react-card/`);
await page.goto('/material-ui/react-card/');

const anchors = page.locator('div > h2#api ~ ul a');

Expand All @@ -54,7 +54,7 @@ test.describe('Material docs', () => {
});

test('should have correct API link to mui-base', async ({ page }) => {
await page.goto(`/material-ui/react-tabs/`);
await page.goto('/material-ui/react-tabs/');

await expect(page.locator('a[href="/base/api/tab-panel-unstyled/"]')).toContainText(
'<TabPanelUnstyled />',
Expand All @@ -71,63 +71,63 @@ test.describe('Material docs', () => {
});

test('should have correct link for sidebar anchor', async ({ page }) => {
await page.goto(`/material-ui/react-card/`);
await page.goto('/material-ui/react-card/');

const anchor = page.locator('nav[aria-label="documentation"] .app-drawer-active');

await expect(anchor).toHaveAttribute('href', `/material-ui/react-card/`);
await expect(anchor).toHaveAttribute('href', '/material-ui/react-card/');
await expect(anchor).toHaveText('Card');
});

test('should have plural url for Tabs', async ({ page }) => {
await page.goto(`/material-ui/react-tabs/`);
await page.goto('/material-ui/react-tabs/');

const anchor = page.locator('nav[aria-label="documentation"] .app-drawer-active');

await expect(anchor).toHaveAttribute('href', `/material-ui/react-tabs/`);
await expect(anchor).toHaveAttribute('href', '/material-ui/react-tabs/');
await expect(anchor).toHaveText('Tabs');
});

test('should have plural url for Breadcrumbs', async ({ page }) => {
await page.goto(`/material-ui/react-breadcrumbs/`);
await page.goto('/material-ui/react-breadcrumbs/');

const anchor = page.locator('nav[aria-label="documentation"] .app-drawer-active');

await expect(anchor).toHaveAttribute('href', `/material-ui/react-breadcrumbs/`);
await expect(anchor).toHaveAttribute('href', '/material-ui/react-breadcrumbs/');
await expect(anchor).toHaveText('Breadcrumbs');
});

test('should not have react- prefix for icons', async ({ page }) => {
await page.goto(`/material-ui/icons/`);
await page.goto('/material-ui/icons/');

const anchor = page.locator('nav[aria-label="documentation"] .app-drawer-active');

await expect(anchor).toHaveAttribute('href', `/material-ui/icons/`);
await expect(anchor).toHaveAttribute('href', '/material-ui/icons/');
await expect(anchor).toHaveText('Icons');
});

test('should not have react- prefix for material-icons', async ({ page }) => {
await page.goto(`/material-ui/material-icons/`);
await page.goto('/material-ui/material-icons/');

const anchor = page.locator('nav[aria-label="documentation"] .app-drawer-active');

await expect(anchor).toHaveAttribute('href', `/material-ui/material-icons/`);
await expect(anchor).toHaveAttribute('href', '/material-ui/material-icons/');
await expect(anchor).toHaveText('Material Icons');
});
});

test.describe('API page', () => {
test('should have correct link for sidebar anchor', async ({ page }) => {
await page.goto(`/material-ui/api/card/`);
await page.goto('/material-ui/api/card/');

const anchor = page.locator('nav[aria-label="documentation"] ul a:text-is("Card")');

await expect(anchor).toHaveAttribute('app-drawer-active', '');
await expect(anchor).toHaveAttribute('href', `/material-ui/api/card/`);
await expect(anchor).toHaveAttribute('href', '/material-ui/api/card/');
});

test('all the links in the main content should have correct prefix', async ({ page }) => {
await page.goto(`/material-ui/api/card/`);
await page.goto('/material-ui/api/card/');

const anchors = page.locator('div#main-content a');

Expand Down Expand Up @@ -168,7 +168,7 @@ test.describe('Material docs', () => {
}
};
test('should have correct link when searching component', async ({ page }) => {
await page.goto(`/material-ui/getting-started/installation/`);
await page.goto('/material-ui/getting-started/installation/');

await page.waitForLoadState('networkidle'); // wait for docsearch

Expand All @@ -178,11 +178,11 @@ test.describe('Material docs', () => {

const anchor = page.locator('.DocSearch-Hits a:has-text("Card")');

await expect(anchor.first()).toHaveAttribute('href', `/material-ui/react-card/#main-content`);
await expect(anchor.first()).toHaveAttribute('href', '/material-ui/react-card/#main-content');
});

test('should have correct link when searching API', async ({ page }) => {
await page.goto(`/material-ui/getting-started/installation/`);
await page.goto('/material-ui/getting-started/installation/');

await page.waitForLoadState('networkidle'); // wait for docsearch

Expand All @@ -192,7 +192,7 @@ test.describe('Material docs', () => {

const anchor = page.locator('.DocSearch-Hits a:has-text("Card API")');

await expect(anchor.first()).toHaveAttribute('href', `/material-ui/api/card/#main-content`);
await expect(anchor.first()).toHaveAttribute('href', '/material-ui/api/card/#main-content');
});
});
});

0 comments on commit 994779a

Please sign in to comment.