-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(css): don't mock css-module if inline is specified (#3952)
Co-authored-by: Adam Hines <ahines@factset.com>
- Loading branch information
1 parent
5a07cff
commit 3891d05
Showing
3 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
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,20 @@ | ||
import { describe, expect, test } from 'vitest' | ||
import { useRemoveStyles } from './utils' | ||
|
||
describe('processing inline css', () => { | ||
useRemoveStyles() | ||
|
||
test('doesn\'t apply css', async () => { | ||
await import('../src/App.module.css?inline') | ||
|
||
const element = document.createElement('div') | ||
element.className = 'main' | ||
const computed = window.getComputedStyle(element) | ||
expect(computed.display, 'css is not processed').toBe('block') | ||
}) | ||
|
||
test('returns a string', async () => { | ||
const { default: style } = await import('../src/App.module.css?inline') | ||
expect(typeof style).toBe('string') | ||
}) | ||
}) |
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