Skip to content

Commit 072b6bb

Browse files
committed
feat: enhance test coverage and implement native test suite
- Expanded the test suite with comprehensive unit and integration tests for notifications and text-to-speech modules, ensuring robust coverage of AsyncStorage access, verse rotation logic, and markdown cleaning. - Configured a TypeScript-ready native test runner using Node's `node:test` and `tsx`, adding tests for core business logic including Bible metadata validation and Supabase environment checks. - Updated `package.json` to include new test scripts and added `tsx` as a dependency. - Verified all tests passed successfully with no linting or type-checking errors.
1 parent 4f4be34 commit 072b6bb

12 files changed

Lines changed: 1055 additions & 9 deletions

AGENT.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,29 @@ These rules govern the development of the Aion project.
99

1010
## Change Log
1111

12+
### 2026-05-21 (Australia/Sydney)
13+
**Raouf:**
14+
- **Scope:** Expansion of Test Suite (TTS & Notifications)
15+
- **Summary:** Added comprehensive unit and integration test coverage for notifications and text-to-speech modules. Verified AsyncStorage storage access toggles, day-of-year verse rotation logic, HTML5 web notification emission structures, custom markdown regex cleaning (stripping bold, italic, headers, and links), and web/native TTS engine hook dispatches.
16+
- **Files Changed:**
17+
- [tests/notifications.test.ts](file:///Users/raoof.r12/Desktop/Raouf/Aion/tests/notifications.test.ts) - Unit tests verifying storage checks, calendar-index rotation, and mock Notification object parameters.
18+
- [tests/tts.test.ts](file:///Users/raoof.r12/Desktop/Raouf/Aion/tests/tts.test.ts) - Unit tests verifying Markdown cleaning regex filters and web/native synthesizers.
19+
- **Verification:** Ran `npm test` executing 15 checks across 6 suites cleanly. Lint and type check tasks run with 0 errors.
20+
- **Follow-ups:** None.
21+
22+
### 2026-05-21 (Australia/Sydney)
23+
**Raouf:**
24+
- **Scope:** Native Test Suite Implementation
25+
- **Summary:** Configured a lightweight TypeScript-ready native test runner using Node's `node:test` and `tsx`. Created comprehensive unit test coverage for core business logic, including Bible metadata validation, daily verse rotation, user setting scales, Supabase environment checks, and timestamp formatting utilities.
26+
- **Files Changed:**
27+
- [package.json](file:///Users/raoof.r12/Desktop/Raouf/Aion/package.json) - Configured `"test"`, `"lint"`, and `"format"` scripts to include the `tests` directory and added `tsx` dependency.
28+
- [tests/bible-data.test.ts](file:///Users/raoof.r12/Desktop/Raouf/Aion/tests/bible-data.test.ts) - Unit tests for Bible books data structure, OT/NT division, and VOTD rotation.
29+
- [tests/settings.test.ts](file:///Users/raoof.r12/Desktop/Raouf/Aion/tests/settings.test.ts) - Unit tests validating font size scales and theme configurations.
30+
- [tests/supabase.test.ts](file:///Users/raoof.r12/Desktop/Raouf/Aion/tests/supabase.test.ts) - Integration tests for Supabase configuration environment variable checks.
31+
- [tests/utils.test.ts](file:///Users/raoof.r12/Desktop/Raouf/Aion/tests/utils.test.ts) - Unit tests for the relative timeago formatting utility.
32+
- **Verification:** Ran `npm test`, `npm run lint`, and `npm run type-check`. All 8 tests passed successfully, and linting/type-checking completed with 0 errors.
33+
- **Follow-ups:** None.
34+
1235
### 2026-05-21 (Australia/Sydney)
1336
**Raouf:**
1437
- **Scope:** UI/UX Premium Enhancements

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

77
## Change Log
88

9+
### 2026-05-21 (Australia/Sydney)
10+
**Raouf:**
11+
- **Scope:** Expansion of Test Suite (TTS & Notifications)
12+
- **Summary:** Added comprehensive unit and integration test coverage for notifications and text-to-speech modules. Verified AsyncStorage storage access toggles, day-of-year verse rotation logic, HTML5 web notification emission structures, custom markdown regex cleaning (stripping bold, italic, headers, and links), and web/native TTS engine hook dispatches.
13+
- **Files Changed:**
14+
- [tests/notifications.test.ts](file:///Users/raoof.r12/Desktop/Raouf/Aion/tests/notifications.test.ts) - Unit tests verifying storage checks, calendar-index rotation, and mock Notification object parameters.
15+
- [tests/tts.test.ts](file:///Users/raoof.r12/Desktop/Raouf/Aion/tests/tts.test.ts) - Unit tests verifying Markdown cleaning regex filters and web/native synthesizers.
16+
- **Verification:** Ran `npm test` executing 15 checks across 6 suites cleanly. Lint and type check tasks run with 0 errors.
17+
- **Follow-ups:** None.
18+
19+
### 2026-05-21 (Australia/Sydney)
20+
**Raouf:**
21+
- **Scope:** Native Test Suite Implementation
22+
- **Summary:** Configured a lightweight TypeScript-ready native test runner using Node's `node:test` and `tsx`. Created comprehensive unit test coverage for core business logic, including Bible metadata validation, daily verse rotation, user setting scales, Supabase environment checks, and timestamp formatting utilities.
23+
- **Files Changed:**
24+
- [package.json](file:///Users/raoof.r12/Desktop/Raouf/Aion/package.json) - Configured `"test"`, `"lint"`, and `"format"` scripts to include the `tests` directory and added `tsx` dependency.
25+
- [tests/bible-data.test.ts](file:///Users/raoof.r12/Desktop/Raouf/Aion/tests/bible-data.test.ts) - Unit tests for Bible books data structure, OT/NT division, and VOTD rotation.
26+
- [tests/settings.test.ts](file:///Users/raoof.r12/Desktop/Raouf/Aion/tests/settings.test.ts) - Unit tests validating font size scales and theme configurations.
27+
- [tests/supabase.test.ts](file:///Users/raoof.r12/Desktop/Raouf/Aion/tests/supabase.test.ts) - Integration tests for Supabase configuration environment variable checks.
28+
- [tests/utils.test.ts](file:///Users/raoof.r12/Desktop/Raouf/Aion/tests/utils.test.ts) - Unit tests for the relative timeago formatting utility.
29+
- **Verification:** Ran `npm test`, `npm run lint`, and `npm run type-check`. All 8 tests passed successfully, and linting/type-checking completed with 0 errors.
30+
- **Follow-ups:** None.
31+
932
### 2026-05-21 (Australia/Sydney)
1033
**Raouf:**
1134
- **Scope:** UI/UX Premium Enhancements

app/(tabs)/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@ export default function HomeScreen() {
131131
<Text style={styles.warningLabel}>Database Setup Required</Text>
132132
</View>
133133
<Text style={styles.warningContent}>
134-
Please update your <Text style={styles.codeText}>.env</Text> file in the project root with your actual Supabase URL and Anon Key, then restart the Expo server.
134+
Please update your <Text style={styles.codeText}>.env</Text> file in the project
135+
root with your actual Supabase URL and Anon Key, then restart the Expo server.
135136
</Text>
136137
</Animated.View>
137138
)}

app/reader/[bookId]/[chapter].tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -402,13 +402,18 @@ export default function ChapterReaderScreen() {
402402
<View style={styles.verseBlock}>
403403
{verses.map((v, i) => {
404404
const isFirstVerse = i === 0;
405-
405+
406406
// Gutenberg drop cap extraction
407407
let dropCap = "";
408408
let remaining = v.content;
409409
if (isFirstVerse && v.content.trim().length > 0) {
410410
const trimmed = v.content.trim();
411-
if (trimmed.startsWith('"') || trimmed.startsWith('“') || trimmed.startsWith('\'') || trimmed.startsWith('‘')) {
411+
if (
412+
trimmed.startsWith('"') ||
413+
trimmed.startsWith("“") ||
414+
trimmed.startsWith("'") ||
415+
trimmed.startsWith("‘")
416+
) {
412417
dropCap = trimmed.slice(0, 2);
413418
remaining = trimmed.slice(2);
414419
} else {
@@ -440,7 +445,7 @@ export default function ChapterReaderScreen() {
440445
</Text>
441446
)}
442447
</View>
443-
448+
444449
{isFirstVerse ? (
445450
<Text
446451
style={[

0 commit comments

Comments
 (0)