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 a16fe99
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions docs/nextConfigBaseline.js
Expand Up @@ -18,7 +18,7 @@ if (

process.env.DEPLOY_ENV = DEPLOY_ENV;

function withBaseline(nextConfig) {
function nextConfigBaseline(nextConfig) {
return {
trailingSlash: true,
// Can be turned on when https://github.com/vercel/next.js/issues/24640 is fixed
Expand Down Expand Up @@ -59,4 +59,4 @@ function withBaseline(nextConfig) {
};
}

module.exports = withBaseline;
module.exports = nextConfigBaseline;
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
2 changes: 1 addition & 1 deletion docs/src/modules/sandbox/StackBlitz.ts
Expand Up @@ -24,7 +24,7 @@ const createReactApp = (demo: {

const { dependencies } = SandboxDependencies(demo, {
// Waiting for https://github.com/stackblitz/core/issues/437
// commitRef: Boolean(process.env.PULL_REQUEST_ID) ? process.env.COMMIT_REF : undefined,
// commitRef: process.env.PULL_REQUEST_ID ? process.env.COMMIT_REF : undefined,
});

return {
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 a16fe99

Please sign in to comment.