-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/web-temporary-event-licence-boolean-check
- Loading branch information
Showing
22 changed files
with
430 additions
and
190 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
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
4 changes: 2 additions & 2 deletions
4
...modules/templates/european-health-insurance-card/european-health-insurance-card.module.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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './lib/decorators/nationalId.decorator' | ||
export * from './lib/decorators/ParsedUserAgent.decorator' | ||
export * from './lib/validators/isPersonNationalId.decorator' | ||
export * from './lib/validators/isNationalId.decorator' |
78 changes: 78 additions & 0 deletions
78
libs/nest/core/src/lib/decorators/ParsedUserAgent.decorator.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,78 @@ | ||
import { parseUserAgent } from './ParsedUserAgent.decorator' | ||
|
||
describe('parseUserAgent Function', () => { | ||
it('should parse new iOS app user agent', () => { | ||
// Arrange | ||
const userAgentString = 'IslandIsApp (1.0.0) Build/321 (ios/9.0.0)' | ||
|
||
// Act | ||
const result = parseUserAgent(userAgentString) | ||
|
||
// Assert | ||
expect(result).toEqual({ | ||
ua: userAgentString, | ||
os: { name: 'iOS', version: '9.0.0' }, | ||
app: { name: 'IslandIsApp', version: '1.0.0', build: 321 }, | ||
}) | ||
}) | ||
|
||
it('should parse new Android app user agent', () => { | ||
// Arrange | ||
const userAgentString = 'IslandIsApp (2.1.0) Build/123 (android/11.0.0)' | ||
|
||
// Act | ||
const result = parseUserAgent(userAgentString) | ||
|
||
// Assert | ||
expect(result).toEqual({ | ||
ua: userAgentString, | ||
os: { name: 'Android', version: '11.0.0' }, | ||
app: { name: 'IslandIsApp', version: '2.1.0', build: 123 }, | ||
}) | ||
}) | ||
|
||
it('should parse old iOS app user agent', () => { | ||
// Arrange | ||
const userAgentString = 'IslandApp/144 CFNetwork/1498.700.2 Darwin/23.6.0' | ||
|
||
// Act | ||
const result = parseUserAgent(userAgentString) | ||
|
||
// Assert | ||
expect(result).toEqual({ | ||
ua: userAgentString, | ||
os: { name: 'iOS' }, | ||
app: { name: 'IslandIsApp' }, | ||
}) | ||
}) | ||
|
||
it('should parse old Android app user agent', () => { | ||
// Arrange | ||
const userAgentString = 'okhttp/4.9.2' | ||
|
||
// Act | ||
const result = parseUserAgent(userAgentString) | ||
|
||
// Assert | ||
expect(result).toEqual({ | ||
ua: userAgentString, | ||
os: { name: 'Android' }, | ||
app: { name: 'IslandIsApp' }, | ||
}) | ||
}) | ||
|
||
it('should return empty app and os for unknown user agent', () => { | ||
// Arrange | ||
const userAgentString = 'UnknownUserAgent/1.0' | ||
|
||
// Act | ||
const result = parseUserAgent(userAgentString) | ||
|
||
// Assert | ||
expect(result).toEqual({ | ||
ua: userAgentString, | ||
os: {}, | ||
app: {}, | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.