1
+ import { describe , expect , it } from "vitest" ;
2
+ import { AboutPage } from "./AboutPage.js" ;
3
+
4
+ describe ( "AboutPage component" , ( ) => {
5
+ it ( "should include CSS stylesheet" , async ( ) => {
6
+ const jsxElement = await AboutPage ( ) ;
7
+
8
+ const html = jsxElement . toString ( ) ;
9
+ expect ( html ) . toContain ( 'href="/components/AboutPage.css"' ) ;
10
+ } ) ;
11
+
12
+ it ( "should contain required content about the project" , async ( ) => {
13
+ const jsxElement = await AboutPage ( ) ;
14
+
15
+ const html = jsxElement . toString ( ) ;
16
+
17
+ // Check for all required content elements
18
+ expect ( html ) . toContain ( "About Mlack" ) ;
19
+ expect ( html ) . toContain ( "Slack-like application that's fully open source" ) ;
20
+ expect ( html ) . toContain ( "@mahata/mlack" ) ;
21
+ expect ( html ) . toContain ( "experimental project" ) ;
22
+ expect ( html ) . toContain ( "Vibe Coding" ) ;
23
+ expect ( html ) . toContain ( "90% of the code is written by" ) ;
24
+ expect ( html ) . toContain ( "GitHub Copilot Coding Agent" ) ;
25
+ } ) ;
26
+
27
+ it ( "should have proper navigation back to main page" , async ( ) => {
28
+ const jsxElement = await AboutPage ( ) ;
29
+
30
+ const html = jsxElement . toString ( ) ;
31
+ expect ( html ) . toContain ( 'href="/"' ) ;
32
+ expect ( html ) . toContain ( "← Back to Chat" ) ;
33
+ } ) ;
34
+
35
+ it ( "should have proper HTML structure" , async ( ) => {
36
+ const jsxElement = await AboutPage ( ) ;
37
+
38
+ const html = jsxElement . toString ( ) ;
39
+ expect ( html ) . toContain ( '<html lang="en">' ) ;
40
+ expect ( html ) . toContain ( "<title>About - Mlack</title>" ) ;
41
+ expect ( html ) . toContain ( 'class="about-container"' ) ;
42
+ expect ( html ) . toContain ( 'class="page-title"' ) ;
43
+ expect ( html ) . toContain ( 'class="content"' ) ;
44
+ expect ( html ) . toContain ( 'class="navigation"' ) ;
45
+ } ) ;
46
+
47
+ it ( "should include external links with proper attributes" , async ( ) => {
48
+ const jsxElement = await AboutPage ( ) ;
49
+
50
+ const html = jsxElement . toString ( ) ;
51
+
52
+ // Check that external links have proper security attributes
53
+ expect ( html ) . toContain ( 'target="_blank"' ) ;
54
+ expect ( html ) . toContain ( 'rel="noopener noreferrer"' ) ;
55
+
56
+ // Check for the GitHub link
57
+ expect ( html ) . toContain ( 'href="https://github.com/mahata/mlack"' ) ;
58
+
59
+ // Check for the Copilot documentation link
60
+ expect ( html ) . toContain ( 'href="https://docs.github.com/en/copilot/concepts/about-copilot-coding-agent"' ) ;
61
+ } ) ;
62
+ } ) ;
0 commit comments