Skip to content

Commit

Permalink
Tests: Switch background image from online file to local 1x1.jpg
Browse files Browse the repository at this point in the history
Also, remove unused `expected` property in `css` test cases.

Closes gh-4866
  • Loading branch information
Krinkle authored May 24, 2021
1 parent e539bac commit 482f846
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 19 deletions.
2 changes: 1 addition & 1 deletion test/data/testsuite.css
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ div#fx-tests div.noback {
#nothiddendivchild.prct { font-size: 150%; }

/* #9239 Attach a background to the body( avoid crashes in removing the test element in support ) */
body, div { background: url(https://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif) no-repeat -1000px 0; }
body, div { background: url(1x1.jpg) no-repeat -1000px 0; }

/* #10501 */
section { background:#f0f; display:block; }
Expand Down
26 changes: 8 additions & 18 deletions test/unit/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -1557,40 +1557,32 @@ QUnit.test(
var done = assert.async();
var styles = [ {
name: "backgroundAttachment",
value: [ "fixed" ],
expected: [ "scroll" ]
value: [ "fixed" ]
}, {
name: "backgroundColor",
value: [ "rgb(255, 0, 0)", "rgb(255,0,0)", "#ff0000" ],
expected: [ "transparent" ]
value: [ "rgb(255, 0, 0)", "rgb(255,0,0)", "#ff0000" ]
}, {

// Firefox returns auto's value
name: "backgroundImage",
value: [ "url('test.png')", "url(" + baseURL + "test.png)", "url(\"" + baseURL + "test.png\")" ],
expected: [ "none", "url(\"https://static.jquery.com/files/rocker/images/logo_jquery_215x53.gif\")" ]
value: [ "url('test.png')", "url(" + baseURL + "test.png)", "url(\"" + baseURL + "test.png\")" ]
}, {
name: "backgroundPosition",
value: [ "5% 5%" ],
expected: [ "0% 0%", "-1000px 0px", "-1000px 0%" ]
value: [ "5% 5%" ]
}, {

// Firefox returns no-repeat
name: "backgroundRepeat",
value: [ "repeat-y" ],
expected: [ "repeat", "no-repeat" ]
value: [ "repeat-y" ]
}, {
name: "backgroundClip",
value: [ "padding-box" ],
expected: [ "border-box" ]
value: [ "padding-box" ]
}, {
name: "backgroundOrigin",
value: [ "content-box" ],
expected: [ "padding-box" ]
value: [ "content-box" ]
}, {
name: "backgroundSize",
value: [ "80px 60px" ],
expected: [ "auto auto" ]
value: [ "80px 60px" ]
} ];

jQuery.each( styles, function( index, style ) {
Expand All @@ -1599,8 +1591,6 @@ QUnit.test(
source = $source[ 0 ],
$children = $source.children();

style.expected = style.expected.concat( [ "", "auto" ] );

if ( source.style[ style.name ] === undefined ) {
assert.ok( true, style.name + ": style isn't supported and therefore not an issue" );
assert.ok( true );
Expand Down

0 comments on commit 482f846

Please sign in to comment.