diff --git a/test/unit/metadata.test.ts b/test/unit/metadata.test.ts index 372bd56..dfa68a9 100644 --- a/test/unit/metadata.test.ts +++ b/test/unit/metadata.test.ts @@ -14,27 +14,32 @@ describe('Metadata Object', () => { it('can be instantiated', context => context.metadata.map(metadataItem => expect(metadataItem).toBeDefined())); - it.todo( - 'is invalid' /*, async context => { - context.invalid.map(async item => - expect(Metadata.validate(item)).resolves.toMatchSnapshot() - ); - }*/ - ); + it.todo('is invalid'); test('get tag()', context => context.metadata.map(metadataItem => expect(metadataItem.tag).toMatchSnapshot() )); - test.todo('set tag()'); + test('set tag()', context => + context.metadata.map(metadataItem => { + metadataItem.tag = 'newTag-aaa'; + expect(metadataItem.tag).toEqual('newTag-aaa'); + })); test('get commentID()', context => context.metadata.map(metadataItem => expect(metadataItem.commentID).toMatchSnapshot() )); - test.todo('set commentID()'); + test('set commentID()', context => + context.metadata.map(metadataItem => { + const originalID = metadataItem.commentID; + const hadID = originalID == undefined ? false : true; + + metadataItem.commentID = '42'; + expect(metadataItem.commentID).toEqual(hadID ? originalID : '42'); + })); test.todo('getMetadata()'); test.todo('setMetadata()');