Skip to content

Commit a3b9a08

Browse files
committed
Added tests for unprefixed properties.
1 parent a034ee6 commit a3b9a08

File tree

1 file changed

+150
-0
lines changed

1 file changed

+150
-0
lines changed

tests/sniper/css_shorthand_tests.js

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,21 @@ addTest("Resolving CSS shorthands", function () {
475475

476476
clear_properties();
477477

478+
set_properties({"-o-transition": "1s"});
479+
480+
assert_rule(
481+
{
482+
properties: [
483+
"-o-transition",
484+
],
485+
values: [
486+
"all 1s cubic-bezier(0.25, 0.1, 0.25, 1) 0",
487+
]
488+
}
489+
);
490+
491+
clear_properties();
492+
478493
set_properties({"-o-transition": "color 1s, opacity 2s"});
479494

480495
assert_rule(
@@ -490,6 +505,50 @@ addTest("Resolving CSS shorthands", function () {
490505

491506
clear_properties();
492507

508+
set_properties({"transition": "1s"});
509+
510+
assert_rule(
511+
{
512+
properties: [
513+
"transition",
514+
],
515+
values: [
516+
"all 1s cubic-bezier(0.25, 0.1, 0.25, 1) 0",
517+
]
518+
}
519+
);
520+
clear_properties();
521+
522+
set_properties({"transition": "1s"});
523+
524+
assert_rule(
525+
{
526+
properties: [
527+
"transition",
528+
],
529+
values: [
530+
"all 1s cubic-bezier(0.25, 0.1, 0.25, 1) 0",
531+
]
532+
}
533+
);
534+
535+
clear_properties();
536+
537+
set_properties({"transition": "color 1s, opacity 2s"});
538+
539+
assert_rule(
540+
{
541+
properties: [
542+
"transition",
543+
],
544+
values: [
545+
"color 1s cubic-bezier(0.25, 0.1, 0.25, 1) 0, opacity 2s cubic-bezier(0.25, 0.1, 0.25, 1) 0",
546+
]
547+
}
548+
);
549+
550+
clear_properties();
551+
493552
set_properties({"columns": "100px 3"});
494553

495554
assert_rule(
@@ -593,6 +652,27 @@ addTest("Resolving CSS shorthands", function () {
593652

594653
clear_properties();
595654

655+
// One missing value in background-attachment has to be repeated
656+
set_properties(
657+
{
658+
"background": "linear-gradient(1deg, rgb(0, 0, 0) 1px, rgb(0, 0, 0) 1px), linear-gradient(1deg, rgb(0, 0, 0) 1px, rgb(0, 0, 0) 1px), linear-gradient(1deg, rgb(0, 0, 0) 1px, rgb(0, 0, 0) 1px)",
659+
"background-attachment": "fixed, scroll",
660+
}
661+
);
662+
663+
assert_rule(
664+
{
665+
properties: [
666+
"background",
667+
],
668+
values: [
669+
"linear-gradient(1deg, rgb(0, 0, 0) 1px, rgb(0, 0, 0) 1px) fixed, linear-gradient(1deg, rgb(0, 0, 0) 1px, rgb(0, 0, 0) 1px), linear-gradient(1deg, rgb(0, 0, 0) 1px, rgb(0, 0, 0) 1px) fixed transparent",
670+
],
671+
}
672+
);
673+
674+
clear_properties();
675+
596676
set_properties(
597677
{
598678
"background": "url(\"data:image/png;1\")",
@@ -713,5 +793,75 @@ addTest("Resolving CSS shorthands", function () {
713793
],
714794
}
715795
);
796+
797+
clear_properties();
798+
799+
set_properties(
800+
{
801+
"animation": "1s, 2s",
802+
}
803+
);
804+
805+
assert_rule(
806+
{
807+
properties: [
808+
"animation",
809+
],
810+
values: [
811+
"1s, 2s",
812+
],
813+
}
814+
);
815+
816+
set_properties(
817+
{
818+
"animation": "1s, 2s",
819+
}
820+
);
821+
822+
assert_rule(
823+
{
824+
properties: [
825+
"animation",
826+
],
827+
values: [
828+
"1s, 2s",
829+
],
830+
}
831+
);
832+
833+
set_properties(
834+
{
835+
"animation": "0s 1s",
836+
}
837+
);
838+
839+
assert_rule(
840+
{
841+
properties: [
842+
"animation",
843+
],
844+
values: [
845+
"0s 1s",
846+
],
847+
}
848+
);
849+
850+
set_properties(
851+
{
852+
"animation": "none, none",
853+
}
854+
);
855+
856+
assert_rule(
857+
{
858+
properties: [
859+
"animation",
860+
],
861+
values: [
862+
"none, none",
863+
],
864+
}
865+
);
716866
});
717867

0 commit comments

Comments
 (0)