-
Notifications
You must be signed in to change notification settings - Fork 789
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Robin Aldenhoven
committed
Oct 28, 2022
1 parent
cd6ed0d
commit 95d89b6
Showing
1 changed file
with
27 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { bootstrapLazy } from '../bootstrap-lazy'; | ||
import { doc } from '@platform'; | ||
|
||
|
||
describe('assets', () => { | ||
|
||
|
||
it('should not append broken css', async () => { | ||
const spy = jest.spyOn(doc.head, 'insertBefore'); | ||
|
||
/** | ||
* To make the test shorter I called bootstrapLazy without any bundles | ||
* When a user call defineCustomElements multiple times it will prevent defining the same elements within | ||
* the bootstrapLazy method. Although this works it does still add the broken css. | ||
*/ | ||
bootstrapLazy([]); | ||
|
||
expect(spy).not.toHaveBeenCalledWith(expect.objectContaining({ | ||
sheet: expect.objectContaining({ | ||
cssRules: [expect.objectContaining({ | ||
// This html is not valid since it does not start with a selector for the visibility hidden block | ||
cssText: '{visibility:hidden}.hydrated{visibility:inherit}' | ||
})] | ||
}) | ||
}), null); | ||
}); | ||
}); |