From b7bf162e6c3bc834097e65936704e3eac59eb4bd Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 2 Jul 2017 15:30:20 +0200 Subject: feat: Use microformats classes Add snapshot-based tests to ensure microformats data can be extracted correctly. --- test/snapshots/app.test.js.md | 163 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 163 insertions(+) create mode 100644 test/snapshots/app.test.js.md (limited to 'test/snapshots/app.test.js.md') diff --git a/test/snapshots/app.test.js.md b/test/snapshots/app.test.js.md new file mode 100644 index 0000000..99811f9 --- /dev/null +++ b/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: '

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!

', + 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: {}, + } -- cgit 1.4.1