mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-06 12:57:46 +00:00
Moves parts of the `@vercel/remix` builder into util functions that have isolated unit tests. No functionality changes.
22 lines
694 B
TypeScript
Vendored
22 lines
694 B
TypeScript
Vendored
import { isLayoutRoute } from '../src/utils';
|
|
|
|
describe('isLayoutRoute()', () => {
|
|
const routes = [
|
|
{ id: 'root' },
|
|
{ id: 'routes/auth', parentId: 'root' },
|
|
{ id: 'routes/login', parentId: 'routes/auth' },
|
|
{ id: 'routes/logout', parentId: 'routes/auth' },
|
|
{ id: 'routes/index', parentId: 'root' },
|
|
];
|
|
|
|
it.each([
|
|
{ id: 'root', expected: true },
|
|
{ id: 'routes/auth', expected: true },
|
|
{ id: 'routes/index', expected: false },
|
|
{ id: 'routes/login', expected: false },
|
|
{ id: 'routes/logout', expected: false },
|
|
])('should return `$expected` for "$id" route', ({ id, expected }) => {
|
|
expect(isLayoutRoute(id, routes)).toEqual(expected);
|
|
});
|
|
});
|