-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[next] Update app test fixture (#8584)
### Related Issues Updates our test fixture for related changes in latest canary of Next.js. Fixes: https://vercel.slack.com/archives/CGU8HUTUH/p1663607276817069 ### 📋 Checklist <!-- Please keep your PR as a Draft until the checklist is complete --> #### Tests - [ ] The code changed/added as part of this PR has been covered with tests - [ ] All tests pass locally with `yarn test-unit` #### Code Review - [ ] This PR has a concise title and thorough description useful to a reviewer - [ ] Issue from task tracker has a link to this PR
- Loading branch information
Showing
41 changed files
with
114 additions
and
168 deletions.
There are no files selected for viewing
File renamed without changes.
10 changes: 10 additions & 0 deletions
10
packages/next/test/fixtures/00-app-dir/app/(newroot)/layout.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
); | ||
} |
18 changes: 0 additions & 18 deletions
18
packages/next/test/fixtures/00-app-dir/app/(newroot)/layout.server.js
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
...app/client-component-route/page.client.js → ...pp-dir/app/client-component-route/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
|
2 changes: 2 additions & 0 deletions
2
...pp-dir/app/client-nested/layout.client.js → ...es/00-app-dir/app/client-nested/layout.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 1 addition & 9 deletions
10
...dashboard/deployments/[id]/page.server.js → ...ir/app/dashboard/deployments/[id]/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
</> | ||
); | ||
} |
File renamed without changes.
8 changes: 8 additions & 0 deletions
8
packages/next/test/fixtures/00-app-dir/app/dashboard/deployments/layout.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} | ||
</> | ||
); | ||
} |
16 changes: 0 additions & 16 deletions
16
packages/next/test/fixtures/00-app-dir/app/dashboard/deployments/layout.server.js
This file was deleted.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
...pp-dir/app/dashboard/index/lazy.client.js → ...es/00-app-dir/app/dashboard/index/lazy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
'client'; | ||
|
||
export default function LazyComponent() { | ||
return ( | ||
<> | ||
|
2 changes: 1 addition & 1 deletion
2
...pp-dir/app/dashboard/index/page.server.js → ...es/00-app-dir/app/dashboard/index/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
...pp-dir/app/dashboard/index/test.client.js → ...es/00-app-dir/app/dashboard/index/test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 0 additions & 8 deletions
8
.../dynamic/[category]/[id]/layout.server.js → ...dir/app/dynamic/[category]/[id]/layout.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
...pp/dynamic/[category]/[id]/page.server.js → ...p-dir/app/dynamic/[category]/[id]/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
...r/app/dynamic/[category]/layout.server.js → ...-app-dir/app/dynamic/[category]/layout.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 0 additions & 8 deletions
8
...s/00-app-dir/app/dynamic/layout.server.js → ...fixtures/00-app-dir/app/dynamic/layout.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
18
packages/next/test/fixtures/00-app-dir/app/layout.server.js
This file was deleted.
Oops, something went wrong.
File renamed without changes.
7 changes: 7 additions & 0 deletions
7
packages/next/test/fixtures/00-app-dir/app/partial-match-[id]/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
</> | ||
); | ||
} |
15 changes: 0 additions & 15 deletions
15
packages/next/test/fixtures/00-app-dir/app/partial-match-[id]/page.server.js
This file was deleted.
Oops, something went wrong.
2 changes: 2 additions & 0 deletions
2
...pp/should-not-serve-client/page.client.js → ...p-dir/app/should-not-serve-client/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
'client'; | ||
|
||
export default function ShouldNotServeClientDotJs(props) { | ||
return ( | ||
<> | ||
|
File renamed without changes.
18 changes: 18 additions & 0 deletions
18
packages/next/test/fixtures/00-app-dir/app/slow-layout-and-page-with-loading/slow/layout.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} | ||
</> | ||
); | ||
} |
17 changes: 0 additions & 17 deletions
17
...next/test/fixtures/00-app-dir/app/slow-layout-and-page-with-loading/slow/layout.server.js
This file was deleted.
Oops, something went wrong.
13 changes: 13 additions & 0 deletions
13
packages/next/test/fixtures/00-app-dir/app/slow-layout-and-page-with-loading/slow/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
} |
12 changes: 0 additions & 12 deletions
12
...s/next/test/fixtures/00-app-dir/app/slow-layout-and-page-with-loading/slow/page.server.js
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
packages/next/test/fixtures/00-app-dir/app/slow-layout-with-loading/slow/layout.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} | ||
</> | ||
); | ||
} |
17 changes: 0 additions & 17 deletions
17
packages/next/test/fixtures/00-app-dir/app/slow-layout-with-loading/slow/layout.server.js
This file was deleted.
Oops, something went wrong.
File renamed without changes.
13 changes: 13 additions & 0 deletions
13
packages/next/test/fixtures/00-app-dir/app/slow-page-with-loading/page.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; | ||
} |
12 changes: 0 additions & 12 deletions
12
packages/next/test/fixtures/00-app-dir/app/slow-page-with-loading/page.server.js
This file was deleted.
Oops, something went wrong.
File renamed without changes.