diff options
Diffstat (limited to 'test/astro-collection.test.js')
-rw-r--r-- | test/astro-collection.test.js | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/test/astro-collection.test.js b/test/astro-collection.test.js deleted file mode 100644 index 3fdb3b817..000000000 --- a/test/astro-collection.test.js +++ /dev/null @@ -1,30 +0,0 @@ -import { suite } from 'uvu'; -import * as assert from 'uvu/assert'; -import { doc } from './test-utils.js'; -import { setup } from './helpers.js'; - -const Collections = suite('Collections'); - -setup(Collections, './fixtures/astro-collection'); - -Collections('generates list & sorts successfully', async ({ runtime }) => { - const result = await runtime.load('/posts'); - const $ = doc(result.contents); - const urls = [ - ...$('#posts a').map(function () { - return $(this).attr('href'); - }), - ]; - assert.equal(urls, ['/post/three', '/post/two']); -}); - -Collections('generates pagination successfully', async ({ runtime }) => { - const result = await runtime.load('/posts'); - const $ = doc(result.contents); - const prev = $('#prev-page'); - const next = $('#next-page'); - assert.equal(prev.length, 0); // this is first page; should be missing - assert.equal(next.length, 1); // this should be on-page -}); - -Collections.run(); |