diff --git a/src/modules/confirm/confirm.component.html b/src/modules/confirm/confirm.component.html index 29470feec..1e1a3c159 100644 --- a/src/modules/confirm/confirm.component.html +++ b/src/modules/confirm/confirm.component.html @@ -1,5 +1,6 @@
- +
{{ message }} diff --git a/src/modules/error/error-modal.service.spec.ts b/src/modules/error/error-modal.service.spec.ts index 975d776d7..e170e1722 100644 --- a/src/modules/error/error-modal.service.spec.ts +++ b/src/modules/error/error-modal.service.spec.ts @@ -1,7 +1,20 @@ -import { SkyErrorModalService } from './error-modal.service'; -import { MockModalService } from './fixtures/mocks'; -import { ErrorModalConfig } from './error-modal-config'; -import { SkyErrorModalFormComponent } from './error-modal-form.component'; +import { + MockModalService +} from './fixtures/mocks'; +import { + SkyErrorModalService +} from './error-modal.service'; +import { + ErrorModalConfig +} from './error-modal-config'; +import { + SkyErrorModalFormComponent +} from './error-modal-form.component'; + +import { + SkyModalConfigurationInterface, + SkyModalService +} from '../modal'; describe('Error modal service', () => { it('Test open is called with correct parameters', () => { @@ -13,13 +26,18 @@ describe('Error modal service', () => { errorCloseText: 'Close button text' }; - const expectedProvider = { provide: ErrorModalConfig, useValue: config }; + const expectedProviders = [{ provide: ErrorModalConfig, useValue: config }]; - let service = new SkyErrorModalService(modalService); + let service = new SkyErrorModalService(modalService as SkyModalService); service.open(config); expect(modalService.openCalls.length).toBe(1); expect(modalService.openCalls[0].component).toBe(SkyErrorModalFormComponent); - expect(modalService.openCalls[0].providers).toEqual([expectedProvider]); + + // Uses the modalService Open overload that takes config + // instead of providers (despite the property name) + let modalConfig = modalService.openCalls[0].providers as SkyModalConfigurationInterface; + expect(modalConfig.ariaRole).toBe('alertdialog'); + expect(modalConfig.providers).toEqual(expectedProviders); }); }); diff --git a/src/modules/error/error-modal.service.ts b/src/modules/error/error-modal.service.ts index f16bd5a3d..66139fb2b 100644 --- a/src/modules/error/error-modal.service.ts +++ b/src/modules/error/error-modal.service.ts @@ -10,6 +10,9 @@ export class SkyErrorModalService { public open(config: ErrorModalConfig) { const providers = [{ provide: ErrorModalConfig, useValue: config }]; - this.modal.open(SkyErrorModalFormComponent, providers); + this.modal.open(SkyErrorModalFormComponent, { + ariaRole: 'alertdialog', + providers: providers + }); } } diff --git a/src/modules/modal/modal-configuration.ts b/src/modules/modal/modal-configuration.ts index 3b6b7c917..6499da365 100644 --- a/src/modules/modal/modal-configuration.ts +++ b/src/modules/modal/modal-configuration.ts @@ -7,6 +7,7 @@ export class SkyModalConfiguration { public size?: string; public ariaDescribedBy?: string; public ariaLabelledBy?: string; + public ariaRole?: string; public tiledBody?: boolean; public helpKey?: string; diff --git a/src/modules/modal/modal.component.html b/src/modules/modal/modal.component.html index 84ca13481..94661754c 100644 --- a/src/modules/modal/modal.component.html +++ b/src/modules/modal/modal.component.html @@ -6,9 +6,10 @@