Skip to content

Commit

Permalink
changed: suggest-agenda.html/spec.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
wChrstphr committed Jan 26, 2025
1 parent f0b9534 commit 6db64ff
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/pages/suggest-agenda/suggest-agenda.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ <h1>Sugestão de Pautas</h1>
<p style="color: #969696; text-align: left; margin-left: 30px">
<small>*Campo obrigatório</small>
</p>
<re-captcha
[siteKey]="siteKey"
(resolved)="onCaptchaResolved($event)">
</re-captcha>


<button type="submit">
<span *ngIf="isSendingEmail">Enviando...</span>
Expand Down
12 changes: 12 additions & 0 deletions src/app/pages/suggest-agenda/suggest-agenda.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { EmailService } from 'src/app/services/email.service';
import { SuggestAgendaComponent } from './suggest-agenda.component';
import { AlertService } from 'src/app/services/alert.service';
import { HttpErrorResponse, HttpHeaders } from '@angular/common/http';
import { environment } from 'src/app/environment/environment';

const mockData = "email has been sent";
const mockError = new HttpErrorResponse({
Expand Down Expand Up @@ -201,4 +202,15 @@ describe('SuggestAgendaComponent', () => {
component.sendSuggestAgenda();
expect(alertSpy).toHaveBeenCalledWith('info', 'Alerta', 'Preencha todos os campos corretamente!');
});

});
export class AppComponent {
siteKey = environment.recaptcha.siteKey; // Pega a chave do ambiente
recaptchaToken: string | null = null;


onCaptchaResolved(token: string | null) {
console.log('Captcha resolvido! Token:', token);
this.recaptchaToken = token; // Salva o token retornado
}}

0 comments on commit 6db64ff

Please sign in to comment.