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

[next] Update app test fixture #8584

Merged
merged 1 commit into from
Sep 19, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/next/test/fixtures/00-app-dir/app/(newroot)/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default function Root({ children }) {
return (
<html className="this-is-another-document-html">
<head>
<title>{`hello world`}</title>
</head>
<body className="this-is-another-document-body">{children}</body>
</html>
);
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'client';

import { useState, useEffect } from 'react';

import style from './style.module.css';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'client';

import { useState, useEffect } from 'react';

import styles from './style.module.css';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
export async function getServerSideProps({ params }) {
return {
props: {
id: params.id,
},
};
}

export default function DeploymentsPage(props) {
return (
<>
<p>hello from app/dashboard/deployments/[id]. ID is: {props.id}</p>
<p>hello from app/dashboard/deployments/[id]. ID is: {props.params.id}</p>
</>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export default function DeploymentsLayout({ message, children }) {
return (
<>
<h2>Deployments hello</h2>
{children}
</>
);
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'client';

export default function LazyComponent() {
return (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ClientComponent } from './test.client.js';
import { ClientComponent } from './test.js';

export default function DashboardIndexPage() {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'client';

import { useState, lazy } from 'react';

const Lazy = lazy(() => import('./lazy.client.js'));
const Lazy = lazy(() => import('./lazy.js'));

export function ClientComponent() {
let [state] = useState('client');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
export async function getServerSideProps({ params }) {
return {
props: {
params,
},
};
}

export default function IdLayout({ children, params }) {
return (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
export async function getServerSideProps({ params }) {
return {
props: {
params,
},
};
}

export default function IdPage({ children, params }) {
return (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
export async function getServerSideProps({ params }) {
return {
props: {
params,
},
};
}

export default function CategoryLayout({ children, params }) {
return (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
export async function getServerSideProps({ params }) {
return {
props: {
params,
},
};
}

export default function DynamicLayout({ children, params }) {
return (
<>
Expand Down
14 changes: 14 additions & 0 deletions packages/next/test/fixtures/00-app-dir/app/layout.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export default function Root({ children }) {
return (
<html className="this-is-the-document-html">
<head>
<title>{`hello world`}</title>
</head>
<body className="this-is-the-document-body">{children}</body>
</html>
);
}

export const config = {
revalidate: 0,
};
18 changes: 0 additions & 18 deletions packages/next/test/fixtures/00-app-dir/app/layout.server.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function DeploymentsPage(props) {
return (
<>
<p>hello from app/partial-match-[id]. ID is: {props.params.id}</p>
</>
);
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'client';

export default function ShouldNotServeClientDotJs(props) {
return (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { experimental_use as use } from 'react';

async function getData() {
await new Promise(resolve => setTimeout(resolve, 1000));
return {
message: 'hello from slow layout',
};
}

export default function SlowLayout(props) {
const data = use(getData());
return (
<>
<p id="slow-layout-message">{data.message}</p>
{props.children}
</>
);
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { experimental_use as use } from 'react';

async function getData() {
await new Promise(resolve => setTimeout(resolve, 5000));
return {
message: 'hello from slow page',
};
}

export default function SlowPage(props) {
const data = use(getData());
return <h1 id="slow-page-message">{data.message}</h1>;
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { experimental_use as use } from 'react';

async function getData() {
await new Promise(resolve => setTimeout(resolve, 5000));
return {
message: 'hello from slow layout',
};
}

export default function SlowLayout(props) {
const data = use(getData());
return (
<>
<p id="slow-layout-message">{data.message}</p>
{props.children}
</>
);
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { experimental_use as use } from 'react';

async function getData() {
await new Promise(resolve => setTimeout(resolve, 5000));
return {
message: 'hello from slow page',
};
}

export default function SlowPage(props) {
const data = use(getData());
return <h1 id="slow-page-message">{data.message}</h1>;
}

This file was deleted.