import { describe, expect, it } from 'vitest';
import { editPathForDoc, newPathForCollection } from '../../lib/collection-routes.js';
describe('editPathForDoc', () => {
    it('routes post-type documents to the section editor (not the generic route)', () => {
        expect(editPathForDoc({ type: 'post' }, 'case-studies', 'abc')).toBe('/posts/case-studies/abc/edit');
        // Regression: a post collection whose slug is literally `posts` must not
        // produce `/posts/abc` (which 404s).
        expect(editPathForDoc({ type: 'post' }, 'posts', 'abc')).toBe('/posts/posts/abc/edit');
    });
    it('routes the Pages collection to the page editor', () => {
        expect(editPathForDoc(undefined, 'pages', 'abc')).toBe('/pages/abc/edit');
    });
    it('falls through to the generic route for ordinary collections', () => {
        expect(editPathForDoc({ type: 'collection' }, 'authors', 'abc')).toBe('/authors/abc');
        expect(editPathForDoc(undefined, 'authors', 'abc')).toBe('/authors/abc');
    });
});
describe('newPathForCollection', () => {
    it('routes new post documents to the post editor', () => {
        expect(newPathForCollection({ type: 'post' }, 'case-studies')).toBe('/posts/case-studies/new');
    });
    it('routes new pages to the page editor', () => {
        expect(newPathForCollection(undefined, 'pages')).toBe('/pages/new');
    });
    it('falls through to the generic new route for ordinary collections', () => {
        expect(newPathForCollection({ type: 'collection' }, 'authors')).toBe('/authors/new');
    });
});
//# sourceMappingURL=collection-routes.test.js.map