Skip to content
This repository has been archived by the owner on Jul 26, 2023. It is now read-only.

.toHaveCss() - cant use integer values because of value.replace() is not a function #280

Open
DemersM opened this issue Feb 26, 2016 · 0 comments

Comments

@DemersM
Copy link

DemersM commented Feb 26, 2016

Im trying to use toHaveCss() matcher with integer values:

expect($('<div style="position:fixed; bottom:0; left:0; right:0; top:0; z-index:10001;"></div>').toHaveCss({bottom: 0, top: 0});

>>>TypeErroTypeError: value.replace is not a function in http://localhost:8080/tests/lib/jasmine/jasmine-jquery.js (line 394)

Ok, I understand the error, Integer dont have replace() function, but if try with string instead the test fails:

expect($('<div style="position:fixed; bottom:0; left:0; right:0; top:0; z-index:10001;"></div>').toHaveCss({bottom: "0", top: "0"});

Expected ({ 0: HTMLNode, length: 1 }) to have css Object({ bottom: '0', top: '0' }).

Is there a way to use that matcher with integer values?
P.S.: top could have string value such "0px" but, z-index cant, so this matcher should handle integer and float.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant