Fixed weird floating footer behavior, updated Timeline to handle new growing scrolling content div, fixed grammar issue on chubby buttons, removed used nginx configs and Dockerfile comments, made Table not go full-w automatically, added tests to ensure no orphaned astro pages or site layout entries exist, dummy sitemap index so code analysis doesn't freak out
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
import { experimental_AstroContainer as AstroContainer } from 'astro/container';
|
||||
import { expect, test } from 'vitest';
|
||||
import Navbar from "@components/Navbar.astro"
|
||||
|
||||
test('Card with slots', async () => {
|
||||
const container = await AstroContainer.create();
|
||||
const result = await container.renderToString(Navbar, {
|
||||
slots: {
|
||||
default: 'Card content',
|
||||
},
|
||||
});
|
||||
|
||||
// expect(result).toContain('This is a card');
|
||||
// expect(result).toContain('Card content');
|
||||
});
|
||||
32
test/endpoints.spec.ts
Normal file
32
test/endpoints.spec.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import {expect, test} from "vitest";
|
||||
|
||||
import {siteLayout, getPaths} from "@data/site-layout.ts";
|
||||
|
||||
// Paths that should be known to Astro statically
|
||||
const astroStaticPaths = new Set(
|
||||
Object.keys(import.meta.glob("/src/pages/**/*.astro"))
|
||||
.map((path) =>
|
||||
path
|
||||
.replace("/src/pages", "")
|
||||
.replace(/index\.astro$/, "")
|
||||
.replace(/\.astro$|\.md$/, "")
|
||||
.replace(/\/$/, "")
|
||||
|| "/"
|
||||
));
|
||||
|
||||
// Paths that exist in the site layout
|
||||
const siteLayoutPaths = new Set([...getPaths(siteLayout), ...getPaths(siteLayout, [], true)]);
|
||||
|
||||
// Paths that exist in Astro's static paths, but not in site layout
|
||||
const astroNotLayoutPaths = astroStaticPaths.difference(siteLayoutPaths);
|
||||
|
||||
// Paths that exist in site layout, but not in Astro's static paths
|
||||
const siteLayoutNotAstroPaths = siteLayoutPaths.difference(astroStaticPaths);
|
||||
|
||||
test('Pages Missing from Site Layout', async () => {
|
||||
expect(astroNotLayoutPaths).toHaveLength(0);
|
||||
});
|
||||
|
||||
test('Pages Missing from Astro Paths', async () => {
|
||||
expect(siteLayoutNotAstroPaths).toHaveLength(0);
|
||||
});
|
||||
Reference in New Issue
Block a user