12 Commits

Author SHA1 Message Date
Erwan MATHIEU
57cd7a99a0 Fix unit tests 2024-09-26 09:12:40 +02:00
Ghostkeeper
37a98cbb6f
Mock HttpRequestManager while changing sync state
This change triggers a cascade of updates and in some cases triggers a sync. The sync trigger also triggers an update of the account permissions which crashes because the HttpRequestManager can't be started on a thread. We shouldn't make HTTP requests from our tests anyway so mock this away.

Contributes to issue CURA-9220.
2022-07-27 11:43:31 +02:00
Ghostkeeper
d52be42e01
Mock HttpRequestManager while changing log-in state
Changing the log-in state causes additional requests to be made to get information from the account. Previously this wasn't a problem because the information was only obtained from other classes such as the DigitalLibrary to get information on how many library projects the user can make. But now that there are triggers in the Account class itself, those triggers get triggered. It'd make additional requests to the account server. We don't want the tests to make such requests.

Contributes to issue CURA-9220.
2022-07-27 11:41:50 +02:00
Ghostkeeper
608cce491d
Remove tests checking for data in UserProfile
The UserProfile is being stored in the account with a simple assignment, and these are just some property getters with a fallback. I don't think we need to test that.
The actual getting of a user profile (and whether that returns correctly when logged out and such) is already tested as part of the OAuth flow where that code lives.

Contributes to issue CURA-8539.
2021-11-22 18:45:04 +01:00
Nino van Hooff
294afdb7ca Connect sync timer to sync() for consistency and add unit tests.
Also rename a function to camelCase

CURA-7473
2020-06-26 16:09:33 +02:00
Kostas Karmas
eac4d3e463 Make login parametrized with a force_logout boolean
Instead of using a separate function to force logging out before
login, login now has a boolean parameter that instructs it to logout
before loging in again, if the user is alread logged in. It then
starts the authorization with a force browser logout first.

CURA-7427
2020-05-12 16:54:41 +02:00
Kostas Karmas
96387ef2aa Add tests for loginWithForcedLogout() in account
CURA-7427
2020-05-12 13:06:47 +02:00
Jaime van Kessel
0862fd493e
Fix some tests not cleaning up correctly after themselves
The PrintInformation test wasn't cleaning up after itself correclty. This
left some stuff behind that the other tests were using. Since this is bad (as at that point
tests can influence other tests), i've fixed that
2019-12-24 16:20:09 +01:00
Jaime van Kessel
00078fd659
Remove a bunch of unused imports 2019-11-08 13:38:42 +01:00
Lipu Fei
2784edb15e Fix tests 2019-05-28 07:57:29 +02:00
Lipu Fei
6db96abe2f Fix tests 2019-05-28 07:48:00 +02:00
Jaime van Kessel
b6643a9fbe Added tests for account API 2019-05-17 14:39:27 +02:00