File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ /*globals describe */
2
+
3
+ var test = require ( "./helpers" ) . test ;
4
+ var testMinimize = require ( "./helpers" ) . testMinimize ;
5
+
6
+ describe ( "rtlcss" , function ( ) {
7
+ var _document
8
+ before ( ( ) => {
9
+ _document = global . document
10
+ global . document = {
11
+ getElementsByTagName : function ( ) {
12
+ return [ {
13
+ getAttribute : function ( ) {
14
+ return 'rtl'
15
+ }
16
+ } ] ;
17
+ }
18
+ } ;
19
+ } )
20
+
21
+ after ( ( ) => {
22
+ global . document = _document
23
+ } )
24
+
25
+ test ( "basic property" , ".class { right: 10px; }" , [
26
+ [ 1 , ".class { left: 10px; }" , "" ]
27
+ ] ) ;
28
+ test ( "multiple properties" , ".class { border-left: 10px; padding-right: 5px; background: red; }" , [
29
+ [ 1 , ".class { border-right: 10px; padding-left: 5px; background: red; }" , "" ]
30
+ ] ) ;
31
+ test ( "ignore" , ".class { /*rtl:begin:ignore*/border-right: 10px;/*rtl:end:ignore*/ left: 10px; }" , [
32
+ [ 1 , ".class {border-right: 10px; right: 10px; }" , "" ]
33
+ ] )
34
+ } ) ;
You can’t perform that action at this time.
0 commit comments