-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aa166a4
commit 5976240
Showing
2 changed files
with
43 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,11 @@ const UATL_FINGERPRINT: Fingerprint = { | |
hash: 'e7d7002d1df0c66f3c0ab706f6511dc534baeae83c0221607696532932af4751' | ||
}; | ||
|
||
const UATL_NESTED_FINGERPRINT: Fingerprint = { | ||
id: '14', | ||
hash: '6e4220f91ae29edacd6ae9f3bfc2525b8e4344755746c04e5dbe912d56f51c32' | ||
}; | ||
|
||
const UATL_FINGERPRINT_UPDATED: Fingerprint = { | ||
id: '14', | ||
hash: '0a93e9d31109b1c7a33342eca2c853c8f0ca71afeb7102e880e211db7f8d8faf' | ||
|
@@ -39,6 +44,28 @@ const TRAIT_D_UNION_FINGERPRINT: Fingerprint = { | |
|
||
const FINGERPRINTS: Fingerprint[] = [UATL_FINGERPRINT, IREPS_FINGERPRINT, FILALIGNE_FINGERPRINT]; | ||
|
||
const UATL_NESTED: DataSource = { | ||
properties: { | ||
id_source: 14, | ||
USER_NOM: 'Université Angevine du Temps Libre (UATL)', | ||
USER_ADRES: '14, rue Pocquet de Livonnières', | ||
USER_QUART: 'Centre Ville', | ||
LAT: 47.47303152, | ||
LNG: -0.54897495, | ||
DATE_MAJ: '2022-09-26 19:18:28', | ||
PUBLIC_: 'Senior (plus de 45 ans)', | ||
ACCES_ORDI: 'Utilisation ordinateur et/ou tablette', | ||
WIFI: 'Accès WIFI', | ||
HORAIRE: '9h à 12h, 14h à 17h hors vacances scolaires', | ||
TRANSPORT: 'Tramway (Ligne A) - arrêt Hôtel de Ville', | ||
TELEPHONE: '02 41 88 96 41', | ||
MAIL: '[email protected]', | ||
SITE_INTER: 'https://uatl-eca.fr/', | ||
code_postal: '49000', | ||
commune: 'Angers' | ||
} | ||
}; | ||
|
||
const UATL: DataSource = { | ||
TYPO_UID: 14, | ||
USER_NOM: 'Université Angevine du Temps Libre (UATL)', | ||
|
@@ -133,6 +160,17 @@ const SOURCE_WITH_CREATE: DataSource[] = [UATL, IREPS, FILALIGNE, TRAIT_D_UNION] | |
|
||
describe('should transform', (): void => { | ||
it('should detect that an item has not changed between two transformations', (): void => { | ||
const itemsToTransform: DiffSinceLastTransform = diffSinceLastTransform('properties.id_source', [UATL_NESTED_FINGERPRINT])([ | ||
UATL_NESTED | ||
]); | ||
|
||
expect(itemsToTransform).toStrictEqual({ | ||
toUpsert: [], | ||
toDelete: [] | ||
}); | ||
}); | ||
|
||
it('should detect that an item has not changed between two transformations with nested key', (): void => { | ||
const itemsToTransform: DiffSinceLastTransform = diffSinceLastTransform(ID_KEY, FINGERPRINTS)(SOURCE); | ||
|
||
expect(itemsToTransform).toStrictEqual({ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters