1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-12-07 23:23:49 +02:00

add two more unit tests

This commit is contained in:
kagahd
2024-02-28 18:50:19 +01:00
parent 8702586e9e
commit 917b738aa8
6 changed files with 56 additions and 0 deletions

View File

@@ -117,6 +117,17 @@ describe('MetadataLoader', () => {
expect(Utils.clone(data)).to.be.deep.equal(expected);
});
it('should read keywords from photo without sidecar file', async () => {
const data = await MetadataLoader.loadPhotoMetadata(path.join(__dirname, '/../../../assets/sidecar/metadata.jpg'));
const expected = require(path.join(__dirname, '/../../../assets/sidecar/metadata.jpg.json'));
expect(Utils.clone(data)).to.be.deep.equal(expected);
});
it('should merge keywords from photo with keywords from sidecar', async () => {
const data = await MetadataLoader.loadPhotoMetadata(path.join(__dirname, '/../../../assets/sidecar/metadata_v2.jpg'));
const expected = require(path.join(__dirname, '/../../../assets/sidecar/metadata_v2.jpg.json')); //"metadata_v2.jpg" is identical to "metadata.jpg" and "metadata_v2.xmp" contains 2 different keywords expect(Utils.clone(data)).to.be.deep.equal(expected);
});
describe('should load jpg with proper height and orientation', () => {
it('jpg 1', async () => {