Skip to content

Commit 0ac2f2c

Browse files
committed
tests: check animation-name
1 parent bccc4ed commit 0ac2f2c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

test/globalFixtures/keyframes.test.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,34 @@ describe('Scoped Keyframes', () => {
2929
expect(output).toBe(expectedOutput);
3030
});
3131

32+
test('Mixed mode on tag selector with animation-name property', async () => {
33+
const source =
34+
'<style module>' +
35+
'h1 { font-size:18px; animation-name:fadeIn; animation-duration:2s; animation-timing-function:ease-in; }' +
36+
'@keyframes fadeIn {0% {opacity:0} 100% {opacity:1}}' +
37+
'</style>' +
38+
'<h1>Title</h1>';
39+
40+
const expectedOutput =
41+
'<style module>' +
42+
'h1 { font-size:18px; animation-name:fadeIn-123; animation-duration:2s; animation-timing-function:ease-in; }' +
43+
'@keyframes -global-fadeIn-123 {0% {opacity:0} 100% {opacity:1}}' +
44+
'</style>' +
45+
'<h1>Title</h1>';
46+
47+
const output = await compiler(
48+
{
49+
source,
50+
},
51+
{
52+
mode: 'mixed',
53+
localIdentName: '[local]-123',
54+
}
55+
);
56+
57+
expect(output).toBe(expectedOutput);
58+
});
59+
3260
test('Native mode with multiple animation properties', async () => {
3361
const source =
3462
'<style module>' +

0 commit comments

Comments
 (0)