BS-002 Establish public marketing routes and navigation
This commit is contained in:
@@ -23,3 +23,5 @@ Only the inherited starter is available; BortStack page implementation has not b
|
||||
BS-001 implementation/manual testing accepted by Captain on 2026-11-10. Captain explicitly authorized commit/merge; BS-001 is Complete under that integration order. Captain authorized BS-002 through BS-004 engagement as a group; task-specific briefs follow in their isolated branches. BS-005 onward remain Proposed. The previously reported missing testtask hook is resolved.
|
||||
|
||||
ChatGPT ZIP snapshot interface reconciled with PitchInvader: `./scripts/create-chatgpt-snapshot.sh`, no arguments, exports the current checkout to `snapshots/bortstack-chatgpt-DATE-COMMIT.zip`. Available in integration root scripts/ and task scripts/. This is separate from testtask’s internal runtime copy. Root export includes integration-checkout content; run in task worktree to export unmerged BS-001 content. Git, dependencies, task/test worktrees, credentials/environment files, keys and databases excluded.
|
||||
|
||||
BS-002 candidate: public routes/navigation now implemented without AuthProvider or public account routes. Unfinished pages are marked/noindex. Lint, 26 unit tests, Vite build, desktop/mobile route/navigation and targeted axe checks passed; 10 inherited npm audit alerts recorded without dependency changes. Separate bs-002 candidate awaiting review; codex remains BS-001.
|
||||
|
||||
+5
-30
@@ -1,36 +1,11 @@
|
||||
# BortStack handoff
|
||||
|
||||
Replaceable supplementary snapshot, 2026-11-10. Captain explicitly ordered operational testtask after the initialization report. This extends BS-001 tooling validation only; Captain subsequently authorized BS-001 commit/merge and engagement of BS-002 through BS-004.
|
||||
Replaceable supplementary snapshot, 2026-11-10. BS-001 Complete and merged into codex at 5226596. Captain engaged BS-002–004 as a dependent group; no group merge/push/deploy authorized.
|
||||
|
||||
## Candidate
|
||||
BS-002 branch/worktree: bs-002 at .task-worktrees/bs-002, based on codex. Public route shell replaces mounted account UI/AuthProvider; backend/inherited standalone account components retained. Approved primary links and honest noindex placeholders implemented. Contact submission is not exposed before BS-007. Local commit prepared as prerequisite for BS-003.
|
||||
|
||||
Branch bs-001; worktree `/home/rob/projects/bortstack/.task-worktrees/bs-001`; base codex/1ec90a0. Snapshot prepared for authorized BS-001 commit/merge. Integration checkout receives maintained scripts/testtask.sh dispatcher. Root executable removed; canonical interface is scripts/testtask.sh. BS-001 commit/merge authorized; no push/deployment.
|
||||
Validation: lint, 26 unit tests, production build passed. Browser checks: 20 route/mobile checks passed, two automated contrast checks caught navbar inheritance; corrected variant and both passed on rerun. No public API session requests. 10 inherited npm audit alerts; no package changes. Backend unchanged, suites not rerun.
|
||||
|
||||
## Run from project folder
|
||||
Next: BS-003 themes/branding, then BS-004 homepage, each isolated from prior task commit. BS-005+ untouched. Master logo and authentic project media missing: use explicitly marked placeholders. Final static SEO/legal/contact content remain later scope.
|
||||
|
||||
```bash
|
||||
./scripts/testtask.sh 001
|
||||
# or ./scripts/testtask.sh TASK-001
|
||||
```
|
||||
|
||||
Default Firefox; terminal remains running. URL http://127.0.0.1:18081/. Ctrl-C stops browser and removes owned task containers/network. Docker images cached; owned snapshot retained for inspection and refreshed on rerun. First build downloads dependencies. Requires installed roborto-testtask, Docker/Compose permissions, Git/Python/flock/Firefox and graphical desktop. See TESTTASK.md.
|
||||
|
||||
Snapshot script is `scripts/create-test-snapshot.py` inside the task worktree; testtask invokes it automatically. It copies exact Git-listed working state including permitted untracked files, excludes local/secret artifacts, verifies hashes, rejects symlinks and refuses replacing unowned snapshots. Source is the task worktree; `.test-worktrees/task-001` is a test-only copy, never development authority. Session lock prevents concurrent refresh. Runtime builds solely from snapshot with disposable SQLite tmpfs, closed registration and email disabled. No SWAG or production configuration.
|
||||
|
||||
## Validation
|
||||
|
||||
Original generation structural validator, source-preservation audit, context validator (zero warnings), shell syntax, tracked whitespace and inherited production Compose config passed. Docker testtask smoke passed build (including Vite production build), migrations, frontend/direct+proxied API HTTP readiness and real headless Firefox startup; engine reached ready and exited 0. Confirmed owned containers/network absent afterward. Snapshot fixture tests proved untracked inclusion, changed-content refresh, deleted-file removal, .env exclusion and full source/snapshot hash equality; concurrent snapshot refused during runtime. Unit/lint/full browser regression suites not run. Captain confirmed acceptance with “task complete” on 2026-11-10.
|
||||
|
||||
Initial smoke trials found port-readiness and nginx/API ordering races; corrected by explicit HTTP readiness before browser startup and API-before-web dependency. Previous missing hook blocker is resolved; stale blocker notes in original source materials are historical.
|
||||
|
||||
## Review gate
|
||||
|
||||
BS-001 implementation/manual testing accepted by Captain on 2026-11-10. Captain explicitly authorized BS-001 commit/merge on 2026-11-10; BS-001 marked Complete for this integration. Final repeatability run from the project root using `./scripts/testtask.sh TASK-001` also reached ready and exited 0; numeric `001` succeeded in the preceding run. BS-002–004 are authorized as a dependent implementation group, with separate local commits/worktrees and no merge or deployment before review; BS-005+ remain Proposed. Missing authentic brand masters/portfolio media and unverified domain/email/legal/hosting remain product blockers. No redesign or API Admin integration.
|
||||
|
||||
ChatGPT ZIP snapshot interface reconciled with PitchInvader: `./scripts/create-chatgpt-snapshot.sh`, no arguments, exports the current checkout to `snapshots/bortstack-chatgpt-DATE-COMMIT.zip`. Available in integration root scripts/ and task scripts/. This is separate from testtask’s internal runtime copy. Root export includes integration-checkout content; run in task worktree to export unmerged BS-001 content. Git, dependencies, task/test worktrees, credentials/environment files, keys and databases excluded.
|
||||
|
||||
## Captain acceptance and cleanup
|
||||
|
||||
Captain confirmed task complete on 2026-11-10. Recorded manual acceptance; a subsequent explicit order authorizes BS-001 commit/merge and BS-002–004 engagement. Checked and cleaned up remaining task-owned Docker resources using the isolated Compose project only. Preserve the accepted BS-001 worktree for traceability during authorized integration.
|
||||
|
||||
Full staged whitespace audit found pre-existing trailing whitespace in inherited template code and preserved source-handoff Markdown hard breaks. These were retained to avoid unrelated source changes; the new snapshot-script whitespace was corrected.
|
||||
Manual test from integration root: ./scripts/testtask.sh TASK-002. Isolated Docker runtime and snapshot tooling inherited from BS-001. Captain acceptance still pending.
|
||||
|
||||
@@ -46,3 +46,15 @@ BS-002 brief should include removing public account/navigation coupling and esta
|
||||
## Lifecycle
|
||||
|
||||
Proposed → Accepted/scoped → In progress → Implementation-ready → Captain/manual acceptance and authorized integration → Complete. No automatic continuation, commit, merge or deployment. Run appropriate checks, refresh context and test snapshots, then request Captain review. Missing logos block final branding; missing screenshots/permissions block portfolio publication; unverified domain/email/legal/hosting block launch.
|
||||
|
||||
## BS-002 — Public frontend route shell
|
||||
|
||||
Status: Implementation-ready; Captain review pending. Accepted by Captain’s group engagement on 2026-11-10.
|
||||
Objective: public marketing routes/navigation independent of inherited authentication.
|
||||
Scope: public router, header/footer, honest placeholders, site description, route/navigation tests.
|
||||
Non-goals: page content for BS-005+, contact submission, backend account deletion, final SEO/prerendering, brand/homepage implementation.
|
||||
Acceptance: approved public paths and case-study path load directly; primary navigation contains Services/Projects/About/Contact; mobile navigation closes on selection; no public login/register/dashboard or AuthProvider/API session dependency; unfinished pages clearly marked and noindex; no invented logo/email/portfolio claims.
|
||||
Validation: frontend unit suite/lint/build; route, mobile and auth-absence browser checks. No backend behavior changed.
|
||||
Dependencies: BS-001 merged at 5226596. Review base codex; branch bs-002, worktree .task-worktrees/bs-002. Dedicated local task commit forms the base for BS-003; no group merge authorization.
|
||||
|
||||
BS-002 validation: ESLint passed; 26 unit tests passed; Vite production build passed; 20 desktop/mobile browser checks passed initially, then both contrast failures were fixed and passed on targeted rerun. No account API requests on public routes. npm audit reported 10 inherited alerts (5 moderate/3 high/2 critical); lockfile unchanged.
|
||||
|
||||
@@ -1,66 +1,39 @@
|
||||
import AxeBuilder from '@axe-core/playwright'
|
||||
import { expect, test } from '@playwright/test'
|
||||
|
||||
const publicPages = [
|
||||
['/', 'Build your application from here'],
|
||||
['/contact', 'Contact'],
|
||||
['/privacy', 'Privacy policy'],
|
||||
['/terms', 'Terms of service'],
|
||||
['/login', 'Login'],
|
||||
['/register', 'Register'],
|
||||
['/forgot-password', 'Reset password'],
|
||||
]
|
||||
|
||||
for (const [path, heading] of publicPages) {
|
||||
test(`${path} renders without horizontal overflow`, async ({ page }) => {
|
||||
for (const [path, heading] of [
|
||||
['/', 'Software development for real-world needs'], ['/services', 'Services'],
|
||||
['/projects', 'Projects'], ['/projects/example', 'Project details'],
|
||||
['/about', 'About BortStack'], ['/contact', 'Contact'], ['/privacy', 'Privacy policy'],
|
||||
['/login', 'Page not found'], ['/dashboard', 'Page not found'],
|
||||
]) {
|
||||
test(`${path} renders without overflow or auth requests`, async ({ page }) => {
|
||||
const errors = []
|
||||
const accountRequests = []
|
||||
page.on('pageerror', error => errors.push(error.message))
|
||||
page.on('request', request => { if (/\/api\//.test(request.url())) accountRequests.push(request.url()) })
|
||||
await page.goto(path)
|
||||
await expect(page.getByRole('heading', { name: heading, exact: true })).toBeVisible()
|
||||
const dimensions = await page.locator('html').evaluate((element) => ({
|
||||
viewport: element.clientWidth,
|
||||
content: element.scrollWidth,
|
||||
}))
|
||||
expect(dimensions.content).toBeLessThanOrEqual(dimensions.viewport)
|
||||
expect(await page.locator('html').evaluate(el => el.scrollWidth <= el.clientWidth)).toBe(true)
|
||||
expect(errors).toEqual([])
|
||||
expect(accountRequests).toEqual([])
|
||||
})
|
||||
}
|
||||
|
||||
test('public shell passes automated accessibility diagnostics', async ({ page }) => {
|
||||
await page.goto('/contact')
|
||||
const results = await new AxeBuilder({ page }).analyze()
|
||||
expect(results.violations).toEqual([])
|
||||
})
|
||||
|
||||
test('skip link is the first keyboard navigation target', async ({ page }) => {
|
||||
test('public shell has accessible landmarks and first keyboard skip link', async ({ page }) => {
|
||||
await page.goto('/')
|
||||
await page.keyboard.press('Tab')
|
||||
const skipLink = page.getByRole('link', { name: 'Skip to main content' })
|
||||
await expect(skipLink).toBeFocused()
|
||||
await expect(skipLink).toHaveAttribute('href', '#main-content')
|
||||
await expect(page.getByRole('link', { name: 'Skip to main content' })).toBeFocused()
|
||||
await expect(page.getByRole('main')).toHaveCount(1)
|
||||
expect((await new AxeBuilder({ page }).analyze()).violations).toEqual([])
|
||||
})
|
||||
|
||||
test('mobile navigation expands and exposes public destinations', async ({ page, isMobile }) => {
|
||||
test.skip(!isMobile, 'mobile navigation diagnostic')
|
||||
test('navigation works and closes on mobile selection', async ({ page, isMobile }) => {
|
||||
await page.goto('/')
|
||||
await page.getByRole('button', { name: 'Toggle navigation' }).click()
|
||||
await expect(page.getByRole('link', { name: 'Contact', exact: true }).first()).toBeVisible()
|
||||
await expect(page.getByRole('link', { name: 'Login', exact: true })).toBeVisible()
|
||||
})
|
||||
|
||||
test('contact form reports mocked delivery success', async ({ page }) => {
|
||||
await page.route('**/api/contact', async (route) => {
|
||||
await route.fulfill({ status: 200, contentType: 'application/json', body: '{"success":true}' })
|
||||
})
|
||||
await page.goto('/contact')
|
||||
await page.getByLabel('Name').fill('Example Person')
|
||||
await page.getByLabel('Email').fill('person@example.com')
|
||||
await page.getByLabel('Subject').fill('A useful question')
|
||||
await page.getByLabel('Message').fill('This message is long enough to be accepted.')
|
||||
await page.getByRole('button', { name: 'Send message' }).click()
|
||||
await expect(page.getByRole('status')).toContainText('message has been sent')
|
||||
})
|
||||
|
||||
test('protected dashboard with no session does not expose its content', async ({ page }) => {
|
||||
await page.goto('/dashboard')
|
||||
await expect(page.getByRole('heading', { name: 'Unauthorized' })).toBeVisible()
|
||||
await expect(page.getByText('Protected application workspace')).toHaveCount(0)
|
||||
await expect(page.locator('meta[name="robots"]')).toHaveAttribute('content', 'noindex, nofollow')
|
||||
const navigation = page.getByRole('navigation', { name: 'Main navigation' })
|
||||
if (isMobile) await page.getByRole('button', { name: 'Toggle navigation' }).click()
|
||||
await navigation.getByRole('link', { name: 'Services', exact: true }).click()
|
||||
await expect(page.getByRole('heading', { name: 'Services', exact: true })).toBeVisible()
|
||||
if (isMobile) await expect(page.getByRole('button', { name: 'Toggle navigation' })).toHaveAttribute('aria-expanded', 'false')
|
||||
await expect(page.getByRole('link', { name: /login|register|dashboard/i })).toHaveCount(0)
|
||||
})
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<meta name="description" content="A reusable Flask and React web application foundation." />
|
||||
<meta name="description" content="Custom software, websites, APIs, hosting and ongoing maintenance for businesses and research projects." />
|
||||
<meta name="robots" content="index, follow" />
|
||||
<meta name="theme-color" content="#343a40" />
|
||||
<title>BortStack</title>
|
||||
|
||||
+30
-44
@@ -1,57 +1,43 @@
|
||||
import "./styles/custom.scss";
|
||||
|
||||
import { BrowserRouter, Routes, Route } from "react-router-dom";
|
||||
import { AuthProvider } from "./contexts/AuthContext";
|
||||
import ProtectedRoute from "./routing/ProtectedRoute";
|
||||
import PageNotFound from "./views/PageNotFound/PageNotFound";
|
||||
|
||||
import Login from "./views/Login/Login";
|
||||
import Register from "./views/Register/Register";
|
||||
import ForgotPassword from "./views/ForgotPassword/ForgotPassword";
|
||||
import ResetPassword from "./views/ResetPassword/ResetPassword";
|
||||
import VerifyEmail from "./views/VerifyEmail/VerifyEmail";
|
||||
import Contact from "./views/Contact/Contact";
|
||||
import Privacy from "./views/Legal/Privacy";
|
||||
import Terms from "./views/Legal/Terms";
|
||||
import Header from "./components/Header/Header";
|
||||
import Footer from "./components/Footer/Footer";
|
||||
import PageMeta from "./components/PageMeta/PageMeta";
|
||||
|
||||
import Homepage from "./views/Home/Homepage";
|
||||
import Dashboard from "./views/Dashboard/Dashboard";
|
||||
import RoutePlaceholder from "./views/RoutePlaceholder";
|
||||
|
||||
const pages = [
|
||||
["services", "Services", "Website development, custom software, APIs and managed hosting."],
|
||||
["projects", "Projects", "Project details will be added after publication permissions and genuine imagery are confirmed."],
|
||||
["projects/:slug", "Project details", "This case study is not available. Only verified, approved work will be published."],
|
||||
["about", "About BortStack", "Business background and working approach are being prepared."],
|
||||
["contact", "Contact", "The enquiry form and verified business email will be available here. Enquiries cannot be submitted yet."],
|
||||
["privacy", "Privacy policy", "Privacy information is awaiting review against the actual website data flows before publication."],
|
||||
];
|
||||
|
||||
const App = () => {
|
||||
export default function App() {
|
||||
return (
|
||||
<div className="app" data-bs-theme="dark">
|
||||
<div className="app">
|
||||
<BrowserRouter>
|
||||
<AuthProvider>
|
||||
<>
|
||||
<a className="skipLink" href="#main-content">Skip to main content</a>
|
||||
<Header />
|
||||
<div id="main-content" className="pageContent" tabIndex="-1">
|
||||
<Routes>
|
||||
<Route index element={<><PageMeta /><Homepage /></>} />
|
||||
<Route element={<ProtectedRoute />}>
|
||||
<Route path="dashboard" element={<><PageMeta title="Dashboard" noIndex /><Dashboard /></>} />
|
||||
</Route>
|
||||
<Route path="login" element={<><PageMeta title="Login" noIndex /><Login /></>} />
|
||||
<Route path="register" element={<><PageMeta title="Register" noIndex /><Register /></>} />
|
||||
<Route path="forgot-password" element={<><PageMeta title="Reset password" noIndex /><ForgotPassword /></>} />
|
||||
<Route path="reset-password" element={<><PageMeta title="Choose a password" noIndex /><ResetPassword /></>} />
|
||||
<Route path="verify-email" element={<><PageMeta title="Verify email" noIndex /><VerifyEmail /></>} />
|
||||
<Route path="contact" element={<><PageMeta title="Contact" description="Contact the application team." /><Contact /></>} />
|
||||
<Route path="privacy" element={<><PageMeta title="Privacy policy" /><Privacy /></>} />
|
||||
<Route path="terms" element={<><PageMeta title="Terms of service" /><Terms /></>} />
|
||||
<Route path="*" element={<><PageMeta title="Page not found" noIndex /><PageNotFound /></>} />
|
||||
</Routes>
|
||||
</div>
|
||||
<Footer />
|
||||
</>
|
||||
</AuthProvider>
|
||||
<a className="skipLink" href="#main-content">Skip to main content</a>
|
||||
<Header />
|
||||
<main id="main-content" className="pageContent" tabIndex="-1">
|
||||
<Routes>
|
||||
<Route index element={<><PageMeta /><Homepage /></>} />
|
||||
{pages.map(([path, title, description]) => (
|
||||
<Route key={path} path={path} element={<>
|
||||
<PageMeta title={title} description={description} noIndex />
|
||||
<RoutePlaceholder title={title} description={description} />
|
||||
</>} />
|
||||
))}
|
||||
<Route path="*" element={<>
|
||||
<PageMeta title="Page not found" noIndex />
|
||||
<RoutePlaceholder title="Page not found" description="This page is not available. Use the navigation to explore BortStack." />
|
||||
</>} />
|
||||
</Routes>
|
||||
</main>
|
||||
<Footer />
|
||||
</BrowserRouter>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default App;
|
||||
}
|
||||
|
||||
@@ -1,33 +1,21 @@
|
||||
import styles from "./Footer.module.scss";
|
||||
import { Container } from "react-bootstrap";
|
||||
import { NavLink } from "react-router-dom";
|
||||
import { site } from "../../config/site";
|
||||
import styles from "./Footer.module.scss";
|
||||
|
||||
const Footer = () => {
|
||||
return (
|
||||
<footer className={styles.footer}>
|
||||
<nav className={styles.links} aria-label="Footer navigation">
|
||||
<NavLink to="/contact">Contact</NavLink>
|
||||
<NavLink to="/privacy">Privacy</NavLink>
|
||||
<NavLink to="/terms">Terms</NavLink>
|
||||
</nav>
|
||||
<div className={styles.developerSlot}>
|
||||
<a
|
||||
href={site.developer.url}
|
||||
aria-label={site.developer.linkLabel}
|
||||
rel="noreferrer"
|
||||
>
|
||||
<img
|
||||
src={site.developer.logoPath}
|
||||
alt={site.developer.name}
|
||||
className={styles.developerLogo}
|
||||
/>
|
||||
export default function Footer() {
|
||||
return <footer className={styles.footer}>
|
||||
<Container>
|
||||
<div className={styles.footerRow}>
|
||||
<p className={styles.copyright}>© {new Date().getFullYear()} BortStack</p>
|
||||
<nav className={styles.links} aria-label="Footer navigation">
|
||||
<NavLink to="/contact">Contact</NavLink>
|
||||
<NavLink to="/privacy">Privacy</NavLink>
|
||||
</nav>
|
||||
<a href={site.developer.url} aria-label={site.developer.linkLabel} rel="noreferrer" className={styles.developerSlot}>
|
||||
<img src={site.developer.logoPath} alt={site.developer.name} className={styles.developerLogo} />
|
||||
</a>
|
||||
</div>
|
||||
<p className={styles.copyright}>
|
||||
© {new Date().getFullYear()} Web App
|
||||
</p>
|
||||
</footer>
|
||||
);
|
||||
};
|
||||
|
||||
export default Footer;
|
||||
</Container>
|
||||
</footer>;
|
||||
}
|
||||
|
||||
@@ -1,28 +1,22 @@
|
||||
import { Container, Navbar } from "react-bootstrap";
|
||||
import { useState } from "react";
|
||||
import { Container, Nav, Navbar } from "react-bootstrap";
|
||||
import { NavLink } from "react-router-dom";
|
||||
import Logo from "../Logo/Logo";
|
||||
import styles from "./Header.module.scss";
|
||||
import PageNav from "../PageNav/PageNav"
|
||||
import Logo from "../Logo/Logo"
|
||||
import { useAuth } from "../../contexts/AuthContext";
|
||||
import GuestNav from "../GuestNav/GuestNav";
|
||||
|
||||
|
||||
const Header = () => {
|
||||
const { user } = useAuth()
|
||||
|
||||
return (
|
||||
<Navbar expand="sm" className={styles.header} variant="dark">
|
||||
<Container>
|
||||
export default function Header() {
|
||||
const [expanded, setExpanded] = useState(false);
|
||||
return <Navbar variant="dark" expand="md" expanded={expanded} onToggle={setExpanded} className={styles.header} aria-label="Main navigation">
|
||||
<Container>
|
||||
<Navbar.Brand as="div"><Logo /></Navbar.Brand>
|
||||
<Navbar.Toggle aria-controls="navbar-nav" />
|
||||
<Navbar.Collapse id="navbar-nav" className={styles.navbarCollapse}>
|
||||
{
|
||||
user ? <PageNav /> : <GuestNav />
|
||||
}
|
||||
|
||||
<Navbar.Toggle aria-controls="main-navigation" aria-expanded={expanded} />
|
||||
<Navbar.Collapse id="main-navigation" className={styles.navbarCollapse}>
|
||||
<Nav>
|
||||
{["Services", "Projects", "About", "Contact"].map(label => (
|
||||
<Nav.Link as={NavLink} key={label} to={`/${label.toLowerCase()}`} onClick={() => setExpanded(false)}>{label}</Nav.Link>
|
||||
))}
|
||||
</Nav>
|
||||
</Navbar.Collapse>
|
||||
</Container>
|
||||
</Navbar>
|
||||
)
|
||||
</Container>
|
||||
</Navbar>;
|
||||
}
|
||||
|
||||
export default Header
|
||||
|
||||
@@ -2,7 +2,7 @@ export const site = Object.freeze({
|
||||
name: "BortStack",
|
||||
defaultTitle: "BortStack",
|
||||
titleTemplate: "%s | BortStack",
|
||||
description: "A reusable Flask and React web application foundation.",
|
||||
description: "Custom software, websites, APIs, hosting and ongoing maintenance for businesses and research projects.",
|
||||
developer: Object.freeze({
|
||||
name: "roborto.net",
|
||||
url: "https://roborto.net/",
|
||||
|
||||
@@ -1,18 +1,8 @@
|
||||
import styles from "./Homepage.module.scss";
|
||||
|
||||
const Homepage = () => {
|
||||
return (
|
||||
<main className={styles.homepage}>
|
||||
<section>
|
||||
<p>Reusable Flask and React application foundation</p>
|
||||
<h1>Build your application from here</h1>
|
||||
<p>
|
||||
Replace this placeholder with the generated project's
|
||||
purpose, primary action, and product-specific content.
|
||||
</p>
|
||||
</section>
|
||||
</main>
|
||||
)
|
||||
import { Container } from "react-bootstrap";
|
||||
export default function Homepage() {
|
||||
return <Container className="routePlaceholder">
|
||||
<p className="eyebrow">BortStack · Website in development</p>
|
||||
<h1>Software development for real-world needs</h1>
|
||||
<p>The approved BortStack homepage is being prepared.</p>
|
||||
</Container>;
|
||||
}
|
||||
|
||||
export default Homepage
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
import { fireEvent, render, screen, within } from "@testing-library/react";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import App from "../App";
|
||||
|
||||
afterEach(() => { window.history.replaceState({}, "", "/"); vi.unstubAllGlobals(); });
|
||||
describe("public marketing routes", () => {
|
||||
it.each([
|
||||
["/services", "Services"], ["/projects", "Projects"],
|
||||
["/projects/example", "Project details"], ["/about", "About BortStack"],
|
||||
["/contact", "Contact"], ["/privacy", "Privacy policy"],
|
||||
["/login", "Page not found"], ["/register", "Page not found"], ["/dashboard", "Page not found"],
|
||||
])("loads %s without account infrastructure", (path, heading) => {
|
||||
const fetchMock = vi.fn();
|
||||
vi.stubGlobal("fetch", fetchMock);
|
||||
window.history.replaceState({}, "", path);
|
||||
render(<App />);
|
||||
expect(screen.getByRole("heading", { level: 1, name: heading })).toBeInTheDocument();
|
||||
expect(fetchMock).not.toHaveBeenCalled();
|
||||
expect(screen.queryByRole("link", { name: /login|register|dashboard/i })).not.toBeInTheDocument();
|
||||
});
|
||||
it("exposes the four marketing links and closes navigation on selection", async () => {
|
||||
render(<App />);
|
||||
const nav = screen.getByRole("navigation", { name: "Main navigation" });
|
||||
fireEvent.click(screen.getByRole("button", { name: "Toggle navigation" }));
|
||||
await within(nav).findByRole("link", { name: "Services" });
|
||||
for (const name of ["Services", "Projects", "About", "Contact"]) {
|
||||
expect(within(nav).getByRole("link", { name })).toBeInTheDocument();
|
||||
}
|
||||
fireEvent.click(within(nav).getByRole("link", { name: "Services" }));
|
||||
expect(screen.getByRole("button", { name: "Toggle navigation" })).toHaveAttribute("aria-expanded", "false");
|
||||
expect(screen.getByRole("heading", { name: "Services" })).toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
@@ -9,9 +9,9 @@ import Terms from "./Legal/Terms";
|
||||
afterEach(() => vi.unstubAllGlobals());
|
||||
|
||||
describe("generic public pages", () => {
|
||||
it("marks homepage content as replaceable", () => {
|
||||
it("shows the marketing homepage shell", () => {
|
||||
render(<MemoryRouter><Homepage /></MemoryRouter>);
|
||||
expect(screen.getByRole("heading", { name: /build your application/i })).toBeInTheDocument();
|
||||
expect(screen.getByRole("heading", { name: /software development for real-world needs/i })).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it("marks legal pages as placeholders", () => {
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
import PropTypes from "prop-types";
|
||||
import { Container } from "react-bootstrap";
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
export default function RoutePlaceholder({ title, description }) {
|
||||
return <Container className="routePlaceholder">
|
||||
<p className="eyebrow">BortStack · Website in development</p>
|
||||
<h1>{title}</h1>
|
||||
<p>{description}</p>
|
||||
<Link to="/">Back to homepage <span aria-hidden="true">→</span></Link>
|
||||
</Container>;
|
||||
}
|
||||
RoutePlaceholder.propTypes = { title: PropTypes.string.isRequired, description: PropTypes.string.isRequired };
|
||||
Reference in New Issue
Block a user