Commit Graph

9 Commits

Author SHA1 Message Date
Julius Härtl be38b924d1 jsunit: harden avatar tests to pass with fractional scaling of elements
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2020-12-29 08:42:34 +01:00
Julius Härtl fd8f0788b1
Fix tests
The avatar plugin should not change the display element, since the
avatar is always shown by default and the display value is up to the
developers

Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-01-08 10:36:06 +01:00
Roeland Jago Douma 325637f4f3
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2017-12-19 18:49:27 +01:00
Morris Jobke d790c27a19
Reduce JSHint errors/warnings
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2017-11-06 09:57:59 +01:00
Daniel Calviño Sánchez ea10a1292a Use "?" instead of user ID as seed for the image placeholder
The seed of the image placeholder is needed to generate the background
color of the image, but as the background color is later overriden any
seed could be used. When no text is explicitly given the seed is used as
text too, so there is no need to pass the user ID and simply using "?"
as seed is enough.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-09-20 18:20:58 +02:00
Daniel Calviño Sánchez ff71dd07a6 Unify appearance of avatars for undefined and unknown users
When calling the jQuery avatar plugin with a user that did not exist
(that is, users for which "/avatar/{user}/{size}" return a JSON response
with an empty "displayname" value) "?" on a grey background was shown.
However, if the jQuery avatar plugin was called with an undefined
JavaScript value then "?" was shown on a bluish background. This commit
unifies both cases to use the grey background.

The unit tests were also modified to ensure that the grey background is
used in both cases.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2017-09-20 17:19:35 +02:00
Christoph Wurst 2317d7bb49
Fix sinon.stub deprecation warnings
Calls to `sinon.stub(obj, 'meth', fn)` are deprecated and therefore
replaced by `sinon.stub(obj, 'meth).callsFake(fn)` as instructed by
the deprecation warning.

This makes the js unit testing output readable again.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
2017-04-24 10:39:37 +02:00
Morris Jobke 34849f7bd3
fix unit tests
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2016-11-23 18:02:23 +01:00
Roeland Jago Douma 1601e8acfe Added js tests for jquery.avatar
* Ceil avatar request size
2015-09-14 10:17:24 +02:00