@@ -61,19 +61,22 @@ describe('linky', function() {
61
61
62
62
it ( 'should optionally add custom attributes' , function ( ) {
63
63
expect ( linky ( "http://example.com" , "_self" , { rel : "nofollow" } ) ) .
64
- toEqual ( '<a rel="nofollow" target="_self" href="http://example.com">http://example.com</a>' ) ;
64
+ toBeOneOf ( '<a rel="nofollow" target="_self" href="http://example.com">http://example.com</a>' ,
65
+ '<a href="http://example.com" target="_self" rel="nofollow">http://example.com</a>' ) ;
65
66
} ) ;
66
67
67
68
68
69
it ( 'should override target parameter with custom attributes' , function ( ) {
69
70
expect ( linky ( "http://example.com" , "_self" , { target : "_blank" } ) ) .
70
- toEqual ( '<a target="_blank" href="http://example.com">http://example.com</a>' ) ;
71
+ toBeOneOf ( '<a target="_blank" href="http://example.com">http://example.com</a>' ,
72
+ '<a href="http://example.com" target="_blank">http://example.com</a>' ) ;
71
73
} ) ;
72
74
73
75
74
76
it ( 'should optionally add custom attributes from function' , function ( ) {
75
77
expect ( linky ( "http://example.com" , "_self" , function ( url ) { return { "class" : "blue" } ; } ) ) .
76
- toEqual ( '<a class="blue" target="_self" href="http://example.com">http://example.com</a>' ) ;
78
+ toBeOneOf ( '<a class="blue" target="_self" href="http://example.com">http://example.com</a>' ,
79
+ '<a href="http://example.com" target="_self" class="blue">http://example.com</a>' ) ;
77
80
} ) ;
78
81
79
82
@@ -86,7 +89,8 @@ describe('linky', function() {
86
89
87
90
it ( 'should strip unsafe attributes' , function ( ) {
88
91
expect ( linky ( "http://example.com" , "_self" , { "class" : "blue" , "onclick" : "alert('Hi')" } ) ) .
89
- toEqual ( '<a class="blue" target="_self" href="http://example.com">http://example.com</a>' ) ;
92
+ toBeOneOf ( '<a class="blue" target="_self" href="http://example.com">http://example.com</a>' ,
93
+ '<a href="http://example.com" target="_self" class="blue">http://example.com</a>' ) ;
90
94
} ) ;
91
95
} ) ;
92
96
} ) ;
0 commit comments