feat: Use microformats classes Add snapshot-based tests to ensure microformats data can be extracted correctly.
1 file changed, 163 insertions(+), 0 deletions(-)
changed files
A test/snapshots/app.test.js.md
@@ -0,0 +1,163 @@ +# Snapshot report for `test/app.test.js` + +The actual snapshot is saved in `app.test.js.snap`. + +Generated by [AVA](https://ava.li). + +## homepage + +> should contain relevant microformats data + + { + items: [ + { + properties: { + name: [ + 'John Doe', + ], + photo: [ + '/static/johndoe.jpg', + ], + url: [ + '/', + ], + }, + type: [ + 'h-card', + ], + }, + { + children: [ + { + properties: { + name: [ + 'This is a test', + ], + published: [ + '2017-01-01T00:00:00.000Z', + ], + url: [ + '/post/testfile', + ], + }, + type: [ + 'h-entry', + ], + value: 'This is a test Sunday, January 1, 2017', + }, + ], + properties: { + name: [ + 'John Doe', + ], + }, + type: [ + 'h-feed', + ], + }, + ], + 'rel-urls': {}, + rels: {}, + } + +## post + +> should contain relevant microformats data + + { + items: [ + { + properties: { + name: [ + 'John Doe', + ], + photo: [ + '/static/johndoe.jpg', + ], + url: [ + '/', + ], + }, + type: [ + 'h-card', + ], + }, + { + properties: { + content: [ + { + html: '<p>Ut enim blandit volutpat maecenas? Volutpat blandit aliquam etiam erat velit, scelerisque in dictum non, consectetur a erat nam at lectus urna duis convallis convallis tellus, id interdum velit laoreet!</p>', + value: 'Ut enim blandit volutpat maecenas? Volutpat blandit aliquam etiam erat velit, scelerisque in dictum non, consectetur a erat nam at lectus urna duis convallis convallis tellus, id interdum velit laoreet!', + }, + ], + name: [ + 'This is a test', + ], + published: [ + '2017-01-01T00:00:00.000Z', + ], + }, + type: [ + 'h-entry', + ], + }, + ], + 'rel-urls': {}, + rels: {}, + } + +## tags + +> should contain relevant microformats data + + { + items: [ + { + properties: { + name: [ + 'John Doe', + ], + photo: [ + '/static/johndoe.jpg', + ], + url: [ + '/', + ], + }, + type: [ + 'h-card', + ], + }, + { + children: [ + { + properties: { + name: [ + 'This is a test', + ], + published: [ + '2017-01-01T00:00:00.000Z', + ], + url: [ + '/post/testfile', + ], + }, + type: [ + 'h-entry', + ], + value: 'This is a test Sunday, January 1, 2017', + }, + ], + properties: { + name: [ + 'A · John Doe', + ], + }, + type: [ + 'h-feed', + ], + }, + ], + 'rel-urls': {}, + rels: {}, + }