2023-03-13 13:42:43 +01:00
|
|
|
import * as similarityCache from '../../lib/services/similarity-check/similarityCache.js';
|
2025-07-23 08:47:26 +02:00
|
|
|
import { get } from '../mocks/mockNotification.js';
|
|
|
|
|
import { mockFredy, providerConfig } from '../utils.js';
|
|
|
|
|
import { expect } from 'chai';
|
2023-03-13 13:42:43 +01:00
|
|
|
import * as provider from '../../lib/provider/immonet.js';
|
2024-01-01 16:14:25 +01:00
|
|
|
|
2020-02-26 09:05:20 +01:00
|
|
|
describe('#immonet testsuite()', () => {
|
2025-07-23 08:47:26 +02:00
|
|
|
after(() => {
|
|
|
|
|
similarityCache.stopCacheCleanup();
|
|
|
|
|
});
|
2025-09-27 09:42:08 +02:00
|
|
|
|
2025-07-23 08:47:26 +02:00
|
|
|
it('should test immonet provider', async () => {
|
|
|
|
|
const Fredy = await mockFredy();
|
2025-09-27 09:42:08 +02:00
|
|
|
provider.init(providerConfig.immonet, [], []);
|
|
|
|
|
|
|
|
|
|
const fredy = new Fredy(provider.config, null, provider.metaInformation.id, 'immonet', similarityCache);
|
|
|
|
|
const listing = await fredy.execute();
|
2023-04-15 18:24:51 +02:00
|
|
|
|
2025-09-27 09:42:08 +02:00
|
|
|
expect(listing).to.be.a('array');
|
|
|
|
|
const notificationObj = get();
|
|
|
|
|
expect(notificationObj).to.be.a('object');
|
|
|
|
|
expect(notificationObj.serviceName).to.equal('immonet');
|
|
|
|
|
notificationObj.payload.forEach((notify) => {
|
|
|
|
|
/** check the actual structure **/
|
|
|
|
|
expect(notify.id).to.be.a('string');
|
|
|
|
|
expect(notify.price).to.be.a('string');
|
|
|
|
|
expect(notify.size).to.be.a('string');
|
|
|
|
|
expect(notify.title).to.be.a('string');
|
|
|
|
|
expect(notify.link).to.be.a('string');
|
|
|
|
|
expect(notify.address).to.be.a('string');
|
|
|
|
|
/** check the values if possible **/
|
|
|
|
|
expect(notify.size).that.does.include('m²');
|
|
|
|
|
expect(notify.title).to.be.not.empty;
|
|
|
|
|
expect(notify.address).to.be.not.empty;
|
2020-02-26 09:05:20 +01:00
|
|
|
});
|
2025-07-23 08:47:26 +02:00
|
|
|
});
|
2020-02-26 09:05:20 +01:00
|
|
|
});
|