-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor for form machine, component (#140)
* fix: update types for form machine WIP * fix: remove default styling from form-element WIP * test: update tests * chore: replace observable with promise in FormValidator * fix: fixed demo validator * chore: removed unused imports * chore: use hydrate for form-elements WIP * test: bump coverage
- Loading branch information
Showing
14 changed files
with
472 additions
and
292 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
36 changes: 36 additions & 0 deletions
36
packages/dgt-components/lib/components/consent/consent-request.component.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,36 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import { Purpose } from '../../models/purpose.model'; | ||
import { define } from '../../util/define'; | ||
import { ConsentRequestComponent } from './consent-request.component'; | ||
|
||
const purpose: Purpose = { | ||
uri: 'https://purpose.uri/', | ||
description: 'test description', | ||
predicates: [ 'https://schema.org/name' ], | ||
icon: 'https://icon.uri/', | ||
}; | ||
|
||
describe('ConsentRequestComponent', () => { | ||
|
||
let component: ConsentRequestComponent; | ||
|
||
beforeEach(() => { | ||
|
||
define('consent-request', ConsentRequestComponent); | ||
|
||
component = window.document.createElement('consent-request') as ConsentRequestComponent; | ||
component.purpose = purpose; | ||
|
||
}); | ||
|
||
it('should instantiate', async () => { | ||
|
||
window.document.body.appendChild(component); | ||
await component.updateComplete; | ||
|
||
expect(component).toBeTruthy(); | ||
expect(component).toBeInstanceOf(ConsentRequestComponent); | ||
|
||
}); | ||
|
||
}); |
36 changes: 36 additions & 0 deletions
36
packages/dgt-components/lib/components/consent/consent-result.component.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,36 @@ | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
import { Purpose } from '../../models/purpose.model'; | ||
import { define } from '../../util/define'; | ||
import { ConsentResultComponent } from './consent-result.component'; | ||
|
||
const purpose: Purpose = { | ||
uri: 'https://purpose.uri/', | ||
description: 'test description', | ||
predicates: [ 'https://schema.org/name' ], | ||
icon: 'https://icon.uri/', | ||
}; | ||
|
||
describe('ConsentResultComponent', () => { | ||
|
||
let component: ConsentResultComponent; | ||
|
||
beforeEach(() => { | ||
|
||
define('consent-result', ConsentResultComponent); | ||
|
||
component = window.document.createElement('consent-result') as ConsentResultComponent; | ||
component.purpose = purpose; | ||
|
||
}); | ||
|
||
it('should instantiate', async () => { | ||
|
||
window.document.body.appendChild(component); | ||
await component.updateComplete; | ||
|
||
expect(component).toBeTruthy(); | ||
expect(component).toBeInstanceOf(ConsentResultComponent); | ||
|
||
}); | ||
|
||
}); |
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
Oops, something went wrong.