2021-08-04 22:23:57 +02:00
|
|
|
import assert from 'assert';
|
|
|
|
|
2020-10-24 19:20:59 +02:00
|
|
|
import Notifications from '../../blue_modules/notifications';
|
|
|
|
Notifications.default = new Notifications();
|
2021-08-04 22:23:57 +02:00
|
|
|
|
2020-07-31 15:43:55 +02:00
|
|
|
describe('notifications', () => {
|
|
|
|
it('can check groundcontrol server uri validity', async () => {
|
2020-10-24 19:20:59 +02:00
|
|
|
assert.ok(await Notifications.isGroundControlUriValid('https://groundcontrol-bluewallet.herokuapp.com'));
|
|
|
|
assert.ok(!(await Notifications.isGroundControlUriValid('https://www.google.com')));
|
2021-03-26 13:54:19 +01:00
|
|
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
|
|
});
|
|
|
|
|
|
|
|
// muted because it causes jest to hang waiting indefinitely
|
|
|
|
it.skip('can check non-responding url', async () => {
|
2020-10-24 19:20:59 +02:00
|
|
|
assert.ok(!(await Notifications.isGroundControlUriValid('https://localhost.com')));
|
2020-07-31 15:43:55 +02:00
|
|
|
});
|
|
|
|
});
|