-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Martin Käser
committed
Mar 21, 2024
1 parent
aa4d904
commit 016bb2f
Showing
10 changed files
with
60 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
backend/src/main/java/ch/puzzle/okr/controller/ClientConfigController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
.../clientconfig/ClientConfigProperties.java → ...zation/ClientCustomizationProperties.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
backend/src/test/java/ch/puzzle/okr/controller/ClientConfigControllerIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
backend/src/test/java/ch/puzzle/okr/service/ClientConfigServiceIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
frontend/src/app/shared/services/chustomization.service.spec.ts
This file was deleted.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
frontend/src/app/shared/services/customization.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { TestBed } from '@angular/core/testing'; | ||
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; | ||
import { CustomizationService } from './customization.service'; | ||
import { DOCUMENT } from '@angular/common'; | ||
import { ConfigService } from '../../config.service'; | ||
import { Observable, of } from 'rxjs'; | ||
|
||
describe('CustomizationService', () => { | ||
let service: CustomizationService; | ||
|
||
const body = { | ||
title: 'title', | ||
favicon: 'favicon', | ||
logo: 'logo', | ||
customStyles: { cssVar1: 'foo' }, | ||
}; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
imports: [HttpClientTestingModule], | ||
providers: [ | ||
{ provide: DOCUMENT, useValue: undefined }, | ||
{ | ||
provide: ConfigService, | ||
useValue: { | ||
config$: of(body), | ||
}, | ||
}, | ||
], | ||
}); | ||
service = TestBed.inject(CustomizationService); | ||
}); | ||
|
||
it('should be created', () => { | ||
const currentConfig = service.getCurrentConfig(); | ||
expect(currentConfig?.title).toBe(body.title); | ||
expect(currentConfig?.logo).toBe(body.logo); | ||
expect(currentConfig?.favicon).toBe(body.favicon); | ||
expect(currentConfig?.customStyles['cssVar1']).toBe(body.customStyles['cssVar1']); | ||
}); | ||
}); |