forked from vercel/next.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test for unused css modules with layout (vercel#41018)
Similar to vercel#40996. This PR only adds a failing test that should pass. Also updates wrong url of previous test. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have a helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have a helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
- Loading branch information
Showing
7 changed files
with
42 additions
and
1 deletion.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
test/e2e/app-dir/app/app/css/css-page/unused-nested/inner/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,3 @@ | ||
export default function Inner() { | ||
return <p>Inner Page</p> | ||
} |
10 changes: 10 additions & 0 deletions
10
test/e2e/app-dir/app/app/css/css-page/unused-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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { layout } from './styles' | ||
|
||
export default function ServerLayout({ children }) { | ||
return ( | ||
<> | ||
<p className={layout.mod}>Layout</p> | ||
{children} | ||
</> | ||
) | ||
} |
3 changes: 3 additions & 0 deletions
3
test/e2e/app-dir/app/app/css/css-page/unused-nested/only-used-in-first-page.module.css
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,3 @@ | ||
.this_should_not_be_included_in_inner_path { | ||
color: wheat; | ||
} |
3 changes: 3 additions & 0 deletions
3
test/e2e/app-dir/app/app/css/css-page/unused-nested/only-used-in-layout.module.css
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,3 @@ | ||
.mod { | ||
color: tomato; | ||
} |
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,5 @@ | ||
import { page } from './styles' | ||
|
||
export default function Page() { | ||
return <p className={page.this_should_not_be_included_in_inner_path}>Page</p> | ||
} |
4 changes: 4 additions & 0 deletions
4
test/e2e/app-dir/app/app/css/css-page/unused-nested/styles.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,4 @@ | ||
import layout from './only-used-in-layout.module.css' | ||
import page from './only-used-in-first-page.module.css' | ||
|
||
export { layout, page } |
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