Skip to content

Commit f7acbe9

Browse files
authored
chore: Version 2025.0.1 - Test & Verbiage Improvements (#126)
* test: Fix test mocks and remove console logs * chore: Bump version to 2025.0.1 and update changelogs * docs: Update CHANGELOG with TimeSlot pipe and UI improvements * changes --------- Co-authored-by: Joel Meaders <joelmeaders@outlook.com>
1 parent cac2e2d commit f7acbe9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+712
-468
lines changed

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to a versioning scheme of `year.minor.patch`.
77

8+
## [2025.0.1] - 2025-11-09
9+
10+
### Added
11+
- **TimeSlot Pipe**: New custom pipe for formatting appointment time slots (e.g., "10AM - 11AM")
12+
- Displays start and end times for one-hour time slots
13+
- Supports timezone parameter for proper time zone handling
14+
- Includes comprehensive unit tests
15+
16+
### Changed
17+
- **UI Improvements**: Updated time display formatting across registration flow
18+
- Date/time selection page now uses TimeSlot pipe for consistent formatting
19+
- Schedule card component uses TimeSlot pipe instead of raw date formatting
20+
- Submit page displays time slots in user-friendly format
21+
- **Translations**: Updated infant toy messaging to be more inclusive
22+
- English: Changed from "gender neutral toys" to "toys for children ages 0-2"
23+
- Spanish: Updated to match new English messaging
24+
25+
### Removed
26+
- Outdated face mask recommendation from event information page
27+
28+
### Fixed
29+
- Test suite compatibility: Updated test mocks and helpers for better reliability
30+
- Removed debug console.log statements from test environment configuration
31+
- Fixed Auth mock to include `authStateReady` method
32+
- Fixed Analytics mock to include proper app structure
33+
- Fixed ActivatedRoute mock to include all required snapshot properties
34+
835
## [2025.0.0] - 2025-11-09
936

1037
### Added

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "santasworkshop",
3-
"version": "2025.0.0",
3+
"version": "2025.0.1",
44
"author": "Joel Meaders",
55
"private": true,
66
"scripts": {

santashop-admin/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
All notable changes to the admin application will be documented in this file.
44

5+
## [2025.0.1] - 2025-11-09
6+
7+
### Fixed
8+
- Test suite compatibility: Updated Auth mock with `authStateReady` method
9+
- Enhanced ActivatedRoute mock with complete snapshot properties
10+
- Improved test helper implementation for better test reliability
11+
512
## [2025.0.0] - 2025-11-09
613

714
### Added

santashop-admin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@santashop/admin",
3-
"version": "2025.0.0",
3+
"version": "2025.0.1",
44
"description": "",
55
"scripts": {
66
"lint": "ng lint santashop-admin --fix --cache",

santashop-admin/src/test-helpers.ts

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ export function createAuthMock(): jasmine.SpyObj<Auth> {
2424
'createUserWithEmailAndPassword',
2525
'sendPasswordResetEmail',
2626
'onAuthStateChanged',
27+
'authStateReady',
2728
]) as jasmine.SpyObj<Auth> & { currentUser: null };
2829
mock.currentUser = null;
29-
mock.onAuthStateChanged = jasmine
30+
const authStateChangedSpy = jasmine
3031
.createSpy('onAuthStateChanged')
31-
.and.returnValue(
32-
() => undefined,
33-
) as unknown as Auth['onAuthStateChanged'];
32+
.and.returnValue(() => undefined);
33+
(mock as any).onAuthStateChanged = authStateChangedSpy;
34+
mock.authStateReady.and.returnValue(Promise.resolve());
3435
return mock;
3536
}
3637

@@ -137,8 +138,13 @@ export function createFirestoreMock(): jasmine.SpyObj<Firestore> {
137138
doc: jasmine.createSpy('doc').and.returnValue(docMock),
138139
_databaseId: { database: 'mock-database' },
139140
type: 'firestore',
140-
app: { name: 'mock-app' },
141-
} as jasmine.SpyObj<Firestore>;
141+
app: {
142+
name: 'mock-app',
143+
options: {},
144+
automaticDataCollectionEnabled: false,
145+
},
146+
toJSON: () => ({}),
147+
} as unknown as jasmine.SpyObj<Firestore>;
142148

143149
// Set circular references so collection/doc references point back to firestore
144150
collectionMock.firestore = firestoreMock;
@@ -333,7 +339,31 @@ export function createActivatedRouteMock(): Partial<ActivatedRoute> {
333339
params: {},
334340
queryParams: {},
335341
data: {},
336-
},
342+
url: [],
343+
fragment: null,
344+
outlet: 'primary',
345+
component: null,
346+
routeName: null,
347+
title: undefined,
348+
routeConfig: null,
349+
root: {} as any,
350+
parent: null,
351+
firstChild: null,
352+
children: [],
353+
pathFromRoot: [] as any,
354+
paramMap: {
355+
get: () => null,
356+
has: () => false,
357+
getAll: () => [],
358+
keys: [],
359+
} as any,
360+
queryParamMap: {
361+
get: () => null,
362+
has: () => false,
363+
getAll: () => [],
364+
keys: [],
365+
} as any,
366+
} as any,
337367
params: of({}),
338368
queryParams: of({}),
339369
data: of({}),

santashop-app/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
All notable changes to the main application will be documented in this file.
44

5+
## [2025.0.1] - 2025-11-09
6+
7+
### Fixed
8+
- Test suite compatibility: Fixed all spec files to use proper mock factories
9+
- Removed debug console.log statements from environment.test.ts
10+
- Updated test helpers with complete Auth mock (including `authStateReady`)
11+
- Fixed Analytics mock to use proper factory pattern
12+
- Enhanced ActivatedRoute mock with all required snapshot properties
13+
- Fixed E2E test to remove unnecessary debug logging
14+
- Improved service spec files with proper dependency mocking
15+
- Fixed guard spec files to use factory-based mocks
16+
517
## [2025.0.0] - 2025-11-09
618

719
### Added

santashop-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@santashop/app",
3-
"version": "2025.0.0",
3+
"version": "2025.0.1",
44
"description": "Coming soon.",
55
"main": "index.js",
66
"scripts": {

santashop-app/src/app/app.component.spec.ts

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@ import { Analytics } from '@angular/fire/analytics';
44
import {
55
provideActivatedRouteMock,
66
createTranslateServiceMock,
7+
createAnalyticsMock,
8+
createModalControllerMock,
79
} from '../test-helpers';
810

9-
import { AlertController, Platform } from '@ionic/angular/standalone';
11+
import {
12+
AlertController,
13+
Platform,
14+
ModalController,
15+
} from '@ionic/angular/standalone';
1016
import { TranslateService } from '@ngx-translate/core';
1117

1218
import { AppComponent } from './app.component';
13-
import { AppStateService } from './core';
19+
import { AppStateService } from '@santashop/core';
1420
import { provideRouter } from '@angular/router';
1521
import { of } from 'rxjs';
1622

@@ -39,14 +45,18 @@ describe('AppComponent', () => {
3945
{ provide: AppStateService, useValue: appStateSpy },
4046
{
4147
provide: Analytics,
42-
useValue: jasmine.createSpyObj('Analytics', ['']),
48+
useFactory: createAnalyticsMock,
4349
},
4450
{
4551
provide: AlertController,
4652
useValue: jasmine.createSpyObj('AlertController', [
4753
'create',
4854
]),
4955
},
56+
{
57+
provide: ModalController,
58+
useValue: createModalControllerMock(),
59+
},
5060
provideActivatedRouteMock(),
5161
],
5262
})

santashop-app/src/app/core/guards/checked-in.guard.spec.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { TestBed } from '@angular/core/testing';
22
import { Auth } from '@angular/fire/auth';
33
import { Firestore } from '@angular/fire/firestore';
44
import { Functions } from '@angular/fire/functions';
5+
import { createAuthMock } from '../../../test-helpers';
56

67
import { CheckedInGuard } from './checked-in.guard';
78

@@ -20,9 +21,7 @@ describe('CheckedInGuard', () => {
2021
},
2122
{
2223
provide: Auth,
23-
useValue: jasmine.createSpyObj('Auth', [
24-
'signInWithEmailAndPassword',
25-
]),
24+
useFactory: createAuthMock,
2625
},
2726
{
2827
provide: Functions,

santashop-app/src/app/core/guards/registration-complete.guard.spec.ts

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ describe('RegistrationCompleteGuard', () => {
4848
});
4949

5050
// Recreate guard with updated observable
51-
guard = new RegistrationCompleteGuard(preregistrationService, router);
51+
guard = TestBed.inject(RegistrationCompleteGuard);
5252

5353
// Act
5454
const value = await firstValueFrom(guard.canActivate());
@@ -62,13 +62,28 @@ describe('RegistrationCompleteGuard', () => {
6262
const mockUrlTree = new UrlTree();
6363
router.parseUrl.and.returnValue(mockUrlTree);
6464

65-
Object.defineProperty(preregistrationService, 'registrationComplete$', {
66-
get: () => of(true),
67-
configurable: true,
65+
// Reconfigure TestBed with new PreRegistrationService mock
66+
TestBed.resetTestingModule();
67+
TestBed.configureTestingModule({
68+
teardown: { destroyAfterEach: false },
69+
providers: [
70+
{
71+
provide: Router,
72+
useValue: router,
73+
},
74+
{
75+
provide: PreRegistrationService,
76+
useValue: jasmine.createSpyObj<PreRegistrationService>(
77+
'prs',
78+
[],
79+
{ registrationComplete$: of(true) },
80+
),
81+
},
82+
],
6883
});
6984

70-
// Recreate guard with updated observable
71-
guard = new RegistrationCompleteGuard(preregistrationService, router);
85+
// Get new guard instance
86+
guard = TestBed.inject(RegistrationCompleteGuard);
7287

7388
// Act
7489
const value = await firstValueFrom(guard.canActivate());

0 commit comments

Comments
 (0)