summaryrefslogtreecommitdiffstats
path: root/core/js/tests
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-12-29 08:35:09 +0100
committerJulius Härtl <jus@bitgrid.net>2020-12-29 08:42:34 +0100
commitbe38b924d1facd88f69c265106f66393fb213f1c (patch)
treef44c6fea0782783e1ac89176a12fe3944b7164d2 /core/js/tests
parent1bb81f8f1100311ba9d88934d6d11427493910c1 (diff)
downloadnextcloud-server-be38b924d1facd88f69c265106f66393fb213f1c.tar.gz
nextcloud-server-be38b924d1facd88f69c265106f66393fb213f1c.zip
jsunit: harden avatar tests to pass with fractional scaling of elements
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'core/js/tests')
-rw-r--r--core/js/tests/specs/jquery.avatarSpec.js16
1 files changed, 8 insertions, 8 deletions
diff --git a/core/js/tests/specs/jquery.avatarSpec.js b/core/js/tests/specs/jquery.avatarSpec.js
index 4e13b7f26ff..420c72d2e9b 100644
--- a/core/js/tests/specs/jquery.avatarSpec.js
+++ b/core/js/tests/specs/jquery.avatarSpec.js
@@ -38,8 +38,8 @@ describe('jquery.avatar tests', function() {
it('undefined', function() {
$div.avatar('foo');
- expect($div.height()).toEqual(64);
- expect($div.width()).toEqual(64);
+ expect(Math.round($div.height())).toEqual(64);
+ expect(Math.round($div.width())).toEqual(64);
});
it('undefined but div has height', function() {
@@ -49,8 +49,8 @@ describe('jquery.avatar tests', function() {
expect(window.Image).toHaveBeenCalled();
window.Image().onerror();
- expect($div.height()).toEqual(9);
- expect($div.width()).toEqual(9);
+ expect(Math.round($div.height())).toEqual(9);
+ expect(Math.round($div.width())).toEqual(9);
});
it('undefined but data size is set', function() {
@@ -60,8 +60,8 @@ describe('jquery.avatar tests', function() {
expect(window.Image).toHaveBeenCalled();
window.Image().onerror();
- expect($div.height()).toEqual(10);
- expect($div.width()).toEqual(10);
+ expect(Math.round($div.height())).toEqual(10);
+ expect(Math.round($div.width())).toEqual(10);
});
@@ -71,8 +71,8 @@ describe('jquery.avatar tests', function() {
expect(window.Image).toHaveBeenCalled();
window.Image().onerror();
- expect($div.height()).toEqual(8);
- expect($div.width()).toEqual(8);
+ expect(Math.round($div.height())).toEqual(8);
+ expect(Math.round($div.width())).toEqual(8);
});
});