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

Add test for server CSS imports #40019

Merged
merged 2 commits into from Aug 28, 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: 9 additions & 1 deletion test/e2e/app-dir/app/app/css/css-page/page.server.js
@@ -1,5 +1,13 @@
import './style.css'
import styles from './style.module.css'

export default function Page() {
return <h1>Page</h1>
return (
<>
<h1>Page</h1>
<div id="cssm" className={styles.mod}>
CSSM
</div>
</>
)
}
3 changes: 3 additions & 0 deletions test/e2e/app-dir/app/app/css/css-page/style.module.css
@@ -0,0 +1,3 @@
.mod {
color: blue;
}
21 changes: 18 additions & 3 deletions test/e2e/app-dir/index.test.ts
Expand Up @@ -1080,9 +1080,24 @@ describe('app dir', () => {
})
})

describe.skip('server pages', () => {
it('should support global css inside server pages', async () => {})
it('should support css modules inside server pages', async () => {})
describe('server pages', () => {
it('should support global css inside server pages', async () => {
const browser = await webdriver(next.url, '/css/css-page')
expect(
await browser.eval(
`window.getComputedStyle(document.querySelector('h1')).color`
)
).toBe('rgb(255, 0, 0)')
})

it('should support css modules inside server pages', async () => {
const browser = await webdriver(next.url, '/css/css-page')
expect(
await browser.eval(
`window.getComputedStyle(document.querySelector('#cssm')).color`
)
).toBe('rgb(0, 0, 255)')
})
})

describe('client layouts', () => {
Expand Down