Skip to content

Commit

Permalink
Split tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Sep 19, 2024
1 parent 8c2f031 commit c9874b8
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 23 deletions.
4 changes: 4 additions & 0 deletions test/development/css-error/app/css-error-1/error-1.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* Correct syntax: input::placeholder */
input:placeholder {
color: red;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use client'

import './error-1.css'

export default function Page() {
return (
<>
Expand Down
8 changes: 8 additions & 0 deletions test/development/css-error/app/css-error-2/error-2.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.rowContainer {
&.header {
/* Correct syntax: &.darktheme */
&:darktheme {
border-bottom-color: var(--accents-2);
}
}
}
11 changes: 11 additions & 0 deletions test/development/css-error/app/css-error-2/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use client'

import './error-2.css'

export default function Page() {
return (
<>
<div></div>
</>
)
}
6 changes: 6 additions & 0 deletions test/development/css-error/app/css-error-3/error-3.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.rowContainer {
/* Correct syntax: &.global(.dark-theme) */
&:global(.dark-theme) & {
background: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.5) 100%);
}
}
11 changes: 11 additions & 0 deletions test/development/css-error/app/css-error-3/page.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
'use client'

import './error-3.css'

export default function Page() {
return (
<>
<div></div>
</>
)
}
19 changes: 0 additions & 19 deletions test/development/css-error/app/global.css

This file was deleted.

2 changes: 0 additions & 2 deletions test/development/css-error/app/layout.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
'use client'

import './global.css'

export default function Layout({ children }) {
return <>{children}</>
}
20 changes: 18 additions & 2 deletions test/development/css-error/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,24 @@ describe('app dir - css', () => {
;(process.env.TURBOPACK ? describe : describe.skip)(
'error handling',
() => {
it('should report human-readable error message for css', async () => {
const browser = await next.browser('/css-error')
it('should report human-readable error message for wrong pseudo class', async () => {
const browser = await next.browser('/css-error-1')

const source = await getRedboxSource(browser)

expect(source).toMatchInlineSnapshot()
})

it('should report human-readable error message for wrong global class', async () => {
const browser = await next.browser('/css-error-2')

const source = await getRedboxSource(browser)

expect(source).toMatchInlineSnapshot()
})

it('should report human-readable error message for wrong css module', async () => {
const browser = await next.browser('/css-error-3')

const source = await getRedboxSource(browser)

Expand Down

0 comments on commit c9874b8

Please sign in to comment.