From b4fd5667461ef741215fc94e7032ed769b3a3238 Mon Sep 17 00:00:00 2001 From: Miguel Cabrerizo <30386061+doncicuto@users.noreply.github.com> Date: Tue, 24 Oct 2023 14:26:24 +0200 Subject: [PATCH] fix: missing ngOnInit fetch data (#6730) * fix: missing ngoninit fetch data * fix: e2e test for sms check setting has been added --------- Co-authored-by: Elio Bischof --- .../notification-sms-provider.component.ts | 7 +++++-- e2e/cypress/e2e/instance/settings/notifications.cy.ts | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/console/src/app/modules/policies/notification-sms-provider/notification-sms-provider.component.ts b/console/src/app/modules/policies/notification-sms-provider/notification-sms-provider.component.ts index eb14ce8a0c..f13a3e6992 100644 --- a/console/src/app/modules/policies/notification-sms-provider/notification-sms-provider.component.ts +++ b/console/src/app/modules/policies/notification-sms-provider/notification-sms-provider.component.ts @@ -1,4 +1,4 @@ -import { Component, Input } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; import { AddSMSProviderTwilioRequest, UpdateSMSProviderTwilioRequest } from 'src/app/proto/generated/zitadel/admin_pb'; import { SMSProvider, SMSProviderConfigState } from 'src/app/proto/generated/zitadel/settings_pb'; @@ -15,7 +15,7 @@ import { DialogAddSMSProviderComponent } from './dialog-add-sms-provider/dialog- templateUrl: './notification-sms-provider.component.html', styleUrls: ['./notification-sms-provider.component.scss'], }) -export class NotificationSMSProviderComponent { +export class NotificationSMSProviderComponent implements OnInit { @Input() public serviceType!: PolicyComponentServiceType; public smsProviders: SMSProvider.AsObject[] = []; @@ -30,6 +30,9 @@ export class NotificationSMSProviderComponent { private toast: ToastService, ) {} + ngOnInit(): void { + this.fetchData(); + } private fetchData(): void { this.smsProvidersLoading = true; this.service diff --git a/e2e/cypress/e2e/instance/settings/notifications.cy.ts b/e2e/cypress/e2e/instance/settings/notifications.cy.ts index 02548d6636..f2685c5d92 100644 --- a/e2e/cypress/e2e/instance/settings/notifications.cy.ts +++ b/e2e/cypress/e2e/instance/settings/notifications.cy.ts @@ -57,6 +57,8 @@ describe('instance notifications', () => { cy.get('[formcontrolname="senderNumber"]').clear().type('2312123132'); cy.get('[data-e2e="save-sms-settings-button"]').click(); cy.shouldConfirmSuccess(); + cy.get('h4').contains('Twilio'); + cy.get('.state').contains('Inactive'); }); }); });