Skip to content

Commit

Permalink
test: animation properties (#1229)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilebottnawi authored Nov 13, 2020
1 parent c1ca32f commit 62e8253
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 0 deletions.
50 changes: 50 additions & 0 deletions test/__snapshots__/modules-option.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12472,6 +12472,56 @@ Array [

exports[`"modules" option should work with the "[local]" placeholder for the "localIdentName" option: warnings 1`] = `Array []`;

exports[`"modules" option should work with the "animation" : errors 1`] = `Array []`;

exports[`"modules" option should work with the "animation" : module 1`] = `
"// Imports
import ___CSS_LOADER_API_IMPORT___ from \\"../../../../src/runtime/api.js\\";
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(function(i){return i[1]});
// Module
___CSS_LOADER_EXPORT___.push([module.id, \\"._2D_a3nRJzeYYTHGyq4Flnv {\\\\n animation: 3s _1mfCY-QJoM3OC5uQJynmBJ;\\\\n}\\\\n\\\\n._2PJ0C1A-J6DQoUOkoQ0iJf {\\\\n animation: _1mfCY-QJoM3OC5uQJynmBJ 3s;\\\\n}\\\\n\\\\n._3YD2YkzQKZPR2NHYPjUkly {\\\\n animation-name: _1mfCY-QJoM3OC5uQJynmBJ;\\\\n}\\\\n\\\\n@keyframes _1mfCY-QJoM3OC5uQJynmBJ {\\\\n 0% {\\\\n background: white;\\\\n }\\\\n 100% {\\\\n background: red;\\\\n }\\\\n}\\", \\"\\"]);
// Exports
___CSS_LOADER_EXPORT___.locals = {
\\"a\\": \\"_2D_a3nRJzeYYTHGyq4Flnv\\",
\\"animationName\\": \\"_1mfCY-QJoM3OC5uQJynmBJ\\",
\\"b\\": \\"_2PJ0C1A-J6DQoUOkoQ0iJf\\",
\\"c\\": \\"_3YD2YkzQKZPR2NHYPjUkly\\"
};
export default ___CSS_LOADER_EXPORT___;
"
`;

exports[`"modules" option should work with the "animation" : result 1`] = `
Array [
Array [
"./modules/issue-1228/source.css",
"._2D_a3nRJzeYYTHGyq4Flnv {
animation: 3s _1mfCY-QJoM3OC5uQJynmBJ;
}

._2PJ0C1A-J6DQoUOkoQ0iJf {
animation: _1mfCY-QJoM3OC5uQJynmBJ 3s;
}

._3YD2YkzQKZPR2NHYPjUkly {
animation-name: _1mfCY-QJoM3OC5uQJynmBJ;
}

@keyframes _1mfCY-QJoM3OC5uQJynmBJ {
0% {
background: white;
}
100% {
background: red;
}
}",
"",
],
]
`;

exports[`"modules" option should work with the "animation" : warnings 1`] = `Array []`;

exports[`"modules" option should work with the "auto" by default for icss: errors 1`] = `Array []`;

exports[`"modules" option should work with the "auto" by default for icss: module 1`] = `
Expand Down
20 changes: 20 additions & 0 deletions test/fixtures/modules/issue-1228/source.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.a {
animation: 3s animationName;
}

.b {
animation: animationName 3s;
}

.c {
animation-name: animationName;
}

@keyframes animationName {
0% {
background: white;
}
100% {
background: red;
}
}
5 changes: 5 additions & 0 deletions test/fixtures/modules/issue-1228/source.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import css from './source.css';

__export__ = css;

export default css;
16 changes: 16 additions & 0 deletions test/modules-option.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1473,4 +1473,20 @@ describe('"modules" option', () => {
expect(getWarnings(stats)).toMatchSnapshot('warnings');
expect(getErrors(stats)).toMatchSnapshot('errors');
});

it('should work with the "animation" ', async () => {
const compiler = getCompiler('./modules/issue-1228/source.js', {
modules: { mode: 'local' },
});
const stats = await compile(compiler);

expect(
getModuleSource('./modules/issue-1228/source.css', stats)
).toMatchSnapshot('module');
expect(getExecutedCode('main.bundle.js', compiler, stats)).toMatchSnapshot(
'result'
);
expect(getWarnings(stats)).toMatchSnapshot('warnings');
expect(getErrors(stats)).toMatchSnapshot('errors');
});
});

0 comments on commit 62e8253

Please sign in to comment.