BS-013 Implement accepted About reference composition
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
import AxeBuilder from '@axe-core/playwright'
|
||||
import { expect, test } from '@playwright/test'
|
||||
|
||||
for (const width of [320, 390, 768, 1024, 1440]) {
|
||||
test(`About renders and navigates at ${width}px`, async ({ page }) => {
|
||||
await page.setViewportSize({ width, height: 900 })
|
||||
const errors = []
|
||||
const failedRequests = []
|
||||
page.on('pageerror', error => errors.push(error.message))
|
||||
page.on('requestfailed', request => failedRequests.push(request.url()))
|
||||
await page.goto('/about')
|
||||
await page.evaluate(() => globalThis.document.fonts.ready)
|
||||
await expect(page.getByRole('region', { name: 'Why BortStack' }).getByRole('article')).toHaveCount(3)
|
||||
await expect(page.getByRole('img', { name: /approved about laptop artwork is missing/i })).toBeVisible()
|
||||
expect(await page.locator('html').evaluate(el => el.scrollWidth <= el.clientWidth)).toBe(true)
|
||||
for (const heading of await page.getByRole('heading').all()) {
|
||||
const box = await heading.boundingBox()
|
||||
expect(box.x).toBeGreaterThanOrEqual(0)
|
||||
expect(box.x + box.width).toBeLessThanOrEqual(width + 1)
|
||||
}
|
||||
await page.getByRole('link', { name: 'Get in Touch' }).click()
|
||||
await expect(page).toHaveURL(/\/contact$/)
|
||||
await expect(page.getByRole('heading', { level: 1, name: 'Contact', exact: true })).toBeVisible()
|
||||
expect(errors).toEqual([])
|
||||
expect(failedRequests).toEqual([])
|
||||
})
|
||||
}
|
||||
|
||||
for (const theme of ['dark', 'light']) {
|
||||
test(`About accessibility and persistent ${theme} theme`, async ({ page, isMobile }) => {
|
||||
await page.addInitScript(theme => { if (!localStorage.getItem('bortstack-theme')) localStorage.setItem('bortstack-theme', theme) }, theme)
|
||||
await page.goto('/about')
|
||||
await page.evaluate(() => globalThis.document.fonts.ready)
|
||||
await expect(page.locator('html')).toHaveAttribute('data-bs-theme', theme)
|
||||
expect((await new AxeBuilder({ page }).analyze()).violations).toEqual([])
|
||||
await page.keyboard.press('Tab')
|
||||
await expect(page.getByRole('link', { name: 'Skip to main content' })).toBeFocused()
|
||||
await page.keyboard.press('Enter')
|
||||
await expect(page.getByRole('main')).toBeFocused()
|
||||
if (isMobile) await page.getByRole('button', { name: 'Toggle navigation' }).click()
|
||||
await expect(page.getByRole('navigation', { name: 'Main navigation' }).getByRole('link', { name: 'About', exact: true })).toHaveAttribute('aria-current', 'page')
|
||||
await page.getByRole('button', { name: `Switch to ${theme === 'dark' ? 'light' : 'dark'} mode` }).click()
|
||||
await page.reload()
|
||||
await expect(page.locator('html')).toHaveAttribute('data-bs-theme', theme === 'dark' ? 'light' : 'dark')
|
||||
})
|
||||
}
|
||||
|
||||
test('About aligns with reference at 1024×1536', async ({ page }, testInfo) => {
|
||||
await page.setViewportSize({ width: 1024, height: 1536 })
|
||||
await page.goto('/about')
|
||||
await page.evaluate(() => globalThis.document.fonts.ready)
|
||||
const hero = await page.getByRole('region', { name: 'About BortStack' }).boundingBox()
|
||||
for (const [actual, reference] of [[hero.x, 52], [hero.y, 74], [hero.height, 492]]) expect(Math.abs(actual - reference)).toBeLessThanOrEqual(5)
|
||||
const firstRow = await page.getByRole('article', { name: 'Practical engineering' }).boundingBox()
|
||||
expect(Math.abs(firstRow.y - 687)).toBeLessThanOrEqual(8)
|
||||
const closing = await page.getByRole('region', { name: /From initial idea to a fully\s*deployed solution\./ }).boundingBox()
|
||||
for (const [actual, reference] of [[closing.x, 30], [closing.y, 1176], [closing.width, 964], [closing.height, 275]]) expect(Math.abs(actual - reference)).toBeLessThanOrEqual(8)
|
||||
await page.screenshot({ path: testInfo.outputPath('about-reference-full.png'), fullPage: true })
|
||||
})
|
||||
+2
-1
@@ -6,11 +6,11 @@ import PageMeta from "./components/PageMeta/PageMeta";
|
||||
import Homepage from "./views/Home/Homepage";
|
||||
import RoutePlaceholder from "./views/RoutePlaceholder";
|
||||
import Services from "./views/Services/Services";
|
||||
import About from "./views/About/About";
|
||||
|
||||
const pages = [
|
||||
["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."],
|
||||
];
|
||||
@@ -25,6 +25,7 @@ export default function App() {
|
||||
<Routes>
|
||||
<Route index element={<><PageMeta /><Homepage /></>} />
|
||||
<Route path="services" element={<><PageMeta title="Services" description="Website development, custom software, API integration and managed hosting from BortStack." /><Services /></>} />
|
||||
<Route path="about" element={<><PageMeta title="About" description="BortStack’s approach to practical software development, clear communication and ongoing support." /><About /></>} />
|
||||
{pages.map(([path, title, description]) => (
|
||||
<Route key={path} path={path} element={<>
|
||||
<PageMeta title={title} description={description} noIndex />
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
import { Container } from "react-bootstrap";
|
||||
import { Link } from "react-router-dom";
|
||||
import { FiImage, FiLayers, FiMail, FiMessageCircle } from "react-icons/fi";
|
||||
import styles from "./About.module.scss";
|
||||
|
||||
const qualities = [
|
||||
{ id: "practical-engineering", title: "Practical engineering", icon: <svg viewBox="0 0 64 64" aria-hidden="true"><path d="m22 12-18 20 18 19m20-39 18 20-18 19m-5-44-10 49" fill="none" stroke="currentColor" strokeWidth="2.8" strokeLinecap="round" strokeLinejoin="round" /></svg>, description: "Fit-for-purpose solutions built with proven tools and a focus on reliability, performance and maintainability." },
|
||||
{ id: "clear-communication", title: "Clear communication", icon: <span className={styles.chatIcon} aria-hidden="true"><FiMessageCircle /><FiMessageCircle /></span>, description: "A straightforward, transparent approach with regular updates and realistic planning throughout your project." },
|
||||
{ id: "long-term-support", title: "Long-term support", icon: <FiLayers aria-hidden="true" />, description: "Ongoing hosting, maintenance and technical support, with the level of support agreed for your project." },
|
||||
];
|
||||
|
||||
export default function About() {
|
||||
return <div className={styles.aboutPage}>
|
||||
<Container>
|
||||
<section className={styles.hero} aria-labelledby="about-heading">
|
||||
<div className={styles.heroCopy}>
|
||||
<p className={styles.eyebrow}>About <span aria-hidden="true" /></p>
|
||||
<h1 id="about-heading">About <span>BortStack</span></h1>
|
||||
<div className={styles.introduction}>
|
||||
<p>BortStack is a software development business focused on practical, reliable solutions for real-world needs.</p>
|
||||
<p>Custom software, web applications and integrated systems, designed, built and maintained with a focus on clear communication, quality and long-term value.</p>
|
||||
<p>From initial planning to development, deployment and ongoing support, BortStack provides an end-to-end service for your project.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className={styles.artwork} role="img" aria-label="Approved About laptop artwork is missing; placeholder awaiting authentic asset">
|
||||
<div className={styles.assetNotice}>
|
||||
<FiImage aria-hidden="true" />
|
||||
<span>Approved laptop artwork pending</span>
|
||||
<small>Original branded illustration required</small>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<section className={styles.why} aria-labelledby="why-about-heading">
|
||||
<h2 id="why-about-heading" className={styles.sectionHeading}>Why <span>BortStack</span><i aria-hidden="true" /></h2>
|
||||
<div className={styles.qualities}>
|
||||
{qualities.map(({ id, title, icon, description }) => <article className={styles.quality} key={id} aria-labelledby={id}>
|
||||
<div className={styles.icon}>{icon}</div>
|
||||
<div className={styles.qualityCopy}><h3 id={id}>{title}</h3><p>{description}</p></div>
|
||||
</article>)}
|
||||
</div>
|
||||
</section>
|
||||
<section className={styles.contact} aria-labelledby="about-contact-heading">
|
||||
<h2 id="about-contact-heading">From initial idea to a fully <br />deployed solution.</h2>
|
||||
<Link to="/contact" className={`btn btn-primary ${styles.contactLink}`}><FiMail aria-hidden="true" /> Get in Touch</Link>
|
||||
</section>
|
||||
</Container>
|
||||
</div>;
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
.aboutPage {
|
||||
overflow: clip;
|
||||
background: radial-gradient(ellipse at 85% 20%, var(--site-glow), transparent 28%);
|
||||
:global(.container) { width: calc(100% - 104px); max-width: 1280px; padding-inline: 0; }
|
||||
}
|
||||
.hero { position: relative; min-height: 492px; padding-top: 50px; border-bottom: 1px solid var(--site-line); }
|
||||
.heroCopy { width: 480px; max-width: 53%; position: relative; z-index: 1; }
|
||||
.eyebrow {
|
||||
display: flex; align-items: center; gap: 18px;
|
||||
color: var(--site-link); font-size: 18px; line-height: 26px; letter-spacing: .15em; font-weight: 600; text-transform: uppercase;
|
||||
margin: 0 0 20px;
|
||||
span { width: 92px; height: 1px; background: linear-gradient(90deg, var(--bs-steel-blue), transparent); }
|
||||
}
|
||||
.hero h1 { font-size: 59.5px; line-height: 67px; font-weight: 600; letter-spacing: -.035em; white-space: nowrap; margin: 0 0 18px; span { color: var(--site-link); } }
|
||||
.introduction p { margin: 0 0 17px; font-size: 17px; line-height: 27px; color: var(--site-text); &:last-child { margin-bottom: 0; } }
|
||||
.artwork { position: absolute; right: -24px; top: 50px; width: 450px; height: 380px; display: grid; place-items: center; background: radial-gradient(ellipse, var(--site-glow), transparent 70%); }
|
||||
.assetNotice { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 310px; padding: 26px; border: 1px dashed var(--site-line); border-radius: 8px; color: var(--site-muted); background: var(--site-surface); text-align: center; svg { width: 32px; height: 32px; color: var(--site-link); } span { font-size: 13px; } small { font-size: 11px; line-height: 17px; } }
|
||||
.why { padding-top: 34px; padding-bottom: 62px; }
|
||||
.sectionHeading { display: flex; align-items: center; gap: 10px; font-size: 44px; line-height: 53px; font-weight: 600; letter-spacing: -.035em; margin: 0 0 32px; span { color: var(--site-link); } i { flex: 1; height: 1px; background: var(--bs-steel-blue); opacity: .8; margin-left: 15px; } }
|
||||
.quality {
|
||||
display: grid; grid-template-columns: 113px 1fr; column-gap: 67px; padding: 21px 0 22px 49px;
|
||||
border-bottom: 1px solid var(--site-line);
|
||||
&:first-child { padding-top: 0; padding-bottom: 23px; }
|
||||
&:last-child { padding-top: 20px; padding-bottom: 0; border-bottom: 0; }
|
||||
}
|
||||
.icon { display: grid; place-items: center; width: 113px; height: 113px; border: 1px solid var(--site-line); border-radius: 20px; background: radial-gradient(ellipse at top left, var(--site-glow), transparent 85%), var(--site-surface); color: var(--site-link); svg { width: 65px; height: 65px; stroke-width: 1.35; } }
|
||||
.chatIcon { position: relative; display: block; width: 70px; height: 70px; svg { position: absolute; width: 50px; height: 50px; &:first-child { right: 0; bottom: 0; } &:last-child { left: 0; top: 0; fill: var(--site-surface); } } }
|
||||
.qualityCopy { padding-top: 8px; h3 { font-size: 26px; line-height: 34px; font-weight: 600; letter-spacing: -.035em; margin: 0 0 4px; } p { color: var(--site-text); font-size: 20px; line-height: 28px; margin: 0; } }
|
||||
.contact {
|
||||
position: relative; isolation: isolate; overflow: hidden;
|
||||
padding: 45px 24px 46px; text-align: center; margin: 2px -22px 28px;
|
||||
border: 1px solid var(--site-line); border-radius: 16px;
|
||||
background: radial-gradient(ellipse at top right, var(--site-glow), transparent 64%), var(--site-surface);
|
||||
&::before, &::after { content: ''; position: absolute; z-index: -1; pointer-events: none; border-top: 1px solid var(--site-line); background: var(--site-glow); }
|
||||
&::before { width: 74%; height: 150%; left: -20%; top: 84%; transform: rotate(17deg); }
|
||||
&::after { width: 90%; height: 190%; right: -31%; top: 75%; transform: rotate(-29deg); }
|
||||
h2 { font-size: 40px; line-height: 48px; font-weight: 600; letter-spacing: -.035em; margin: 0 0 26px; }
|
||||
}
|
||||
.contactLink { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 60px; padding: 12px 36px; font-size: 22px; line-height: 34px; font-weight: 600; border-radius: 9px; svg { width: 29px; height: 29px; } }
|
||||
:global(.app):has(.aboutPage) :global(nav[aria-label="Main navigation"]) {
|
||||
min-height: 74px;
|
||||
&::after { left: 30px; right: 30px; }
|
||||
:global(.container) { min-height: 73px; }
|
||||
:global(.nav-link[aria-current="page"]) { position: relative; &::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; background: var(--site-link); } }
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
.heroCopy { width: 620px; }
|
||||
.hero { min-height: 520px; }
|
||||
.hero h1 { font-size: 64px; line-height: 74px; }
|
||||
.introduction p { font-size: 19px; line-height: 30px; }
|
||||
.artwork { width: 48%; height: 410px; }
|
||||
}
|
||||
@media (min-width: 768px) and (max-width: 991.98px) {
|
||||
.aboutPage :global(.container) { width: calc(100% - 64px); }
|
||||
.hero { padding-top: 40px; }
|
||||
.heroCopy { width: 410px; max-width: 58%; }
|
||||
.hero h1 { font-size: 43px; line-height: 53px; }
|
||||
.introduction p { font-size: 15px; line-height: 25px; }
|
||||
.artwork { width: 40%; right: -15px; top: 65px; height: 330px; }
|
||||
.assetNotice { max-width: 240px; padding: 18px; }
|
||||
.sectionHeading { font-size: 36px; line-height: 45px; }
|
||||
.quality { padding-left: 15px; grid-template-columns: 95px 1fr; column-gap: 38px; }
|
||||
.icon { width: 95px; height: 95px; svg { width: 53px; height: 53px; } }
|
||||
.chatIcon { width: 58px; height: 58px; svg { width: 42px; height: 42px; } }
|
||||
.qualityCopy { padding-top: 2px; h3 { font-size: 23px; line-height: 31px; } p { font-size: 16px; line-height: 25px; } }
|
||||
.contact { margin-inline: -10px; h2 { font-size: 36px; line-height: 44px; } }
|
||||
}
|
||||
@media (max-width: 767.98px) {
|
||||
.aboutPage :global(.container) { width: calc(100% - 40px); }
|
||||
.hero { padding-top: 32px; min-height: auto; }
|
||||
.heroCopy { width: 100%; max-width: none; }
|
||||
.eyebrow { font-size: 13px; line-height: 21px; margin-bottom: 16px; }
|
||||
.hero h1 { font-size: clamp(34px, 8vw, 48px); line-height: 1.15; margin-bottom: 20px; }
|
||||
.introduction p { font-size: 15px; line-height: 25px; }
|
||||
.artwork { position: relative; width: 100%; height: 230px; top: auto; right: auto; margin-block: 20px; }
|
||||
.why { padding-top: 28px; padding-bottom: 32px; }
|
||||
.sectionHeading { font-size: 30px; line-height: 39px; gap: 7px; margin-bottom: 22px; i { margin-left: 6px; } }
|
||||
.quality { grid-template-columns: 64px 1fr; column-gap: 20px; padding: 22px 0; &:first-child { padding-bottom: 22px; } &:last-child { padding-top: 22px; } }
|
||||
.icon { width: 64px; height: 64px; border-radius: 14px; svg { width: 37px; height: 37px; } }
|
||||
.chatIcon { width: 42px; height: 42px; svg { width: 31px; height: 31px; } }
|
||||
.qualityCopy { padding-top: 0; h3 { font-size: 18px; line-height: 25px; margin-bottom: 5px; } p { font-size: 14px; line-height: 23px; } }
|
||||
.contact { padding: 30px 17px; margin: 0 -5px 22px; h2 { font-size: 28px; line-height: 36px; margin-bottom: 24px; br { display: none; } } }
|
||||
.contactLink { min-height: 48px; font-size: 17px; line-height: 25px; padding: 10px 24px; svg { width: 23px; height: 23px; } }
|
||||
:global(.app):has(.aboutPage) :global(nav[aria-label="Main navigation"]) { min-height: 67px; &::after { left: 20px; right: 20px; } :global(.container) { min-height: 43px; } }
|
||||
}
|
||||
@media (max-width: 359.98px) {
|
||||
.hero h1 { font-size: 30px; }
|
||||
.sectionHeading { font-size: 26px; }
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { render, screen, within } from "@testing-library/react";
|
||||
import { MemoryRouter } from "react-router-dom";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import About from "./About";
|
||||
|
||||
describe("About page", () => {
|
||||
it("presents the business and three approved working qualities without invented credentials", () => {
|
||||
render(<MemoryRouter><About /></MemoryRouter>);
|
||||
expect(screen.getByRole("heading", { level: 1, name: "About BortStack" })).toBeInTheDocument();
|
||||
const why = screen.getByRole("region", { name: "Why BortStack" });
|
||||
expect(within(why).getAllByRole("article")).toHaveLength(3);
|
||||
for (const name of ["Practical engineering", "Clear communication", "Long-term support"]) {
|
||||
expect(within(why).getByRole("heading", { name, level: 3 })).toBeInTheDocument();
|
||||
}
|
||||
expect(within(why).getByText(/support agreed for your project/i)).toBeInTheDocument();
|
||||
expect(screen.queryByText(/award-winning|years of experience|unlimited|guaranteed uptime/i)).not.toBeInTheDocument();
|
||||
});
|
||||
it("keeps missing artwork explicit and directs the invitation to the existing contact route", () => {
|
||||
render(<MemoryRouter><About /></MemoryRouter>);
|
||||
expect(screen.getByRole("img", { name: /approved about laptop artwork is missing/i })).toBeInTheDocument();
|
||||
expect(screen.getByRole("link", { name: "Get in Touch" })).toHaveAttribute("href", "/contact");
|
||||
expect(screen.queryByRole("textbox")).not.toBeInTheDocument();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user