From 0b3b80d5076069cb53b04aeb3507c1a38788552e Mon Sep 17 00:00:00 2001 From: R-enanVieira Date: Wed, 21 Aug 2024 23:12:19 -0300 Subject: [PATCH 01/10] =?UTF-8?q?Correcao=20da=20valida=C3=A7=C3=A3o=20do?= =?UTF-8?q?=20numero=20de=20telefone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../suggest-agenda/suggest-agenda.component.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/app/pages/suggest-agenda/suggest-agenda.component.ts b/src/app/pages/suggest-agenda/suggest-agenda.component.ts index 1b52a0ec..48da39ed 100755 --- a/src/app/pages/suggest-agenda/suggest-agenda.component.ts +++ b/src/app/pages/suggest-agenda/suggest-agenda.component.ts @@ -28,13 +28,24 @@ export class SuggestAgendaComponent implements OnInit { quando: [''], local: [''], responsavel: ['', [Validators.required]], - telefoneResponsavel: ['', [Validators.required]], + telefoneResponsavel: ['', [this.validacaoTelefone()]], emailContato: ['', [Validators.pattern('^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$')]], urlVideo: ['', [this.validacaoUrl()]] }, ); } + validacaoTelefone(): ValidatorFn { + return (control: AbstractControl): { [key: string]: any } | null => { + if (control.value == '') { + return null; + } + const padrao_telefone = /^\(?[1-9]{2}\)? ?(?:[2-8]|9[0-9])[0-9]{3}\-?[0-9]{4}$/; + const valido = padrao_telefone.test(control.value); + return valido ? null : { telefone_invalido: { value: control.value } }; + } + } + validacaoUrl(): ValidatorFn{ return (control:AbstractControl):{[key: string]:any}| null => { if(control.value == ''){ @@ -71,7 +82,9 @@ export class SuggestAgendaComponent implements OnInit { this.isSendingEmail = false; }); } else { - if(this.suggestAgendaForm.controls['urlVideo'].errors?.['url_invalida']){ + if(this.suggestAgendaForm.controls['telefoneResponsavel'].errors?.['telefone_invalido']){ + this.alertService.showMessage("error", "Erro", "Telefone inválido"); + } else if(this.suggestAgendaForm.controls['urlVideo'].errors?.['url_invalida']){ this.alertService.showMessage("error", "Erro", "Serviços válidos: Youtube, Google Drive, Microsoft Stream, Streamable e Vimeo."); }else{ this.alertService.showMessage("info", "Alerta", "Preencha todos os campos corretamente!"); From 434387d80f351b3eed602d9eb54aec43e573e633 Mon Sep 17 00:00:00 2001 From: R-enanVieira Date: Wed, 21 Aug 2024 23:13:19 -0300 Subject: [PATCH 02/10] Correcao do placeholder de email --- src/app/pages/suggest-agenda/suggest-agenda.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/suggest-agenda/suggest-agenda.component.html b/src/app/pages/suggest-agenda/suggest-agenda.component.html index 37eaed7e..4fbf0550 100755 --- a/src/app/pages/suggest-agenda/suggest-agenda.component.html +++ b/src/app/pages/suggest-agenda/suggest-agenda.component.html @@ -62,7 +62,7 @@

Sugestão de Pautas

class="input first button" name="email-contato" formControlName="emailContato" - placeholder="@example.xxx" + placeholder="seuemail@exemplo.com" /> Date: Thu, 22 Aug 2024 14:02:44 -0300 Subject: [PATCH 03/10] =?UTF-8?q?FIX:=20posi=C3=A7=C3=A3o=20das=20checkbox?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/pages/catalog/catalog.component.css | 11 ++++++++--- src/app/pages/catalog/catalog.component.html | 11 +++++++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/app/pages/catalog/catalog.component.css b/src/app/pages/catalog/catalog.component.css index 0f74106a..0da50626 100755 --- a/src/app/pages/catalog/catalog.component.css +++ b/src/app/pages/catalog/catalog.component.css @@ -28,10 +28,15 @@ box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25); } +.first-checkbox { + margin-left: 5.625cm; /* Margem aplicada apenas ao primeiro checkbox */ +} + .checkbox-container { - display: flex; - align-items: center; - margin-left: 0.625em; /* Adiciona algum espaço entre o campo de pesquisa e a checkbox */ + display: inline-flex; + justify-content: center; + /* align-items: center; */ + /* margin-left: 9.625em; /* Adiciona algum espaço entre o campo de pesquisa e a checkbox */ } diff --git a/src/app/pages/catalog/catalog.component.html b/src/app/pages/catalog/catalog.component.html index f3f84980..b8e99597 100755 --- a/src/app/pages/catalog/catalog.component.html +++ b/src/app/pages/catalog/catalog.component.html @@ -1,12 +1,15 @@
-
From 84f8c513f019f4300b1cf781f450beb368220289 Mon Sep 17 00:00:00 2001 From: Luidooo Date: Thu, 22 Aug 2024 17:30:43 -0300 Subject: [PATCH 04/10] modificando a maneira do checkbox das categorias --- .../category-table.component.html | 2 +- .../category-table.component.ts | 38 +++++++++++++------ 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/src/app/pages/category-table/category-table.component.html b/src/app/pages/category-table/category-table.component.html index 474864f4..c8bcdd92 100644 --- a/src/app/pages/category-table/category-table.component.html +++ b/src/app/pages/category-table/category-table.component.html @@ -64,4 +64,4 @@

Dados - Categorias

-
\ No newline at end of file + diff --git a/src/app/pages/category-table/category-table.component.ts b/src/app/pages/category-table/category-table.component.ts index 55750dea..6f1baa09 100644 --- a/src/app/pages/category-table/category-table.component.ts +++ b/src/app/pages/category-table/category-table.component.ts @@ -32,6 +32,7 @@ export class CategoryTableComponent { "Séries Especiais", "UnBTV", "Variedades" + ]; filteredAggregatedVideos: any[] = []; selectedCategories: { [key: string]: boolean } = {}; @@ -44,13 +45,15 @@ export class CategoryTableComponent { private authService: AuthService, private confirmationService: ConfirmationService ) {}; - + ngOnInit(): void{ this.categories.forEach(category => this.selectedCategories[category] = false); - this.selectedCategories["Todas"] = true; + this.categories.forEach(category => { + this.selectedCategories[category] = true; + }); this.findAll(); } - + findAll(): void { this.videoService.findAll().subscribe({ next: (data) => { @@ -107,7 +110,7 @@ export class CategoryTableComponent { this.aggregatedVideos = Array.from(categoryMap.entries()).map(([category, data]) => ({ category, - videoCount: data.count, + videoCount: data.count, totalViews: data.views, viewsPerVideo: data.count > 0 ? data.views/data.count : 0 })); @@ -141,17 +144,28 @@ export class CategoryTableComponent { this.sortAscending = true; } this.sortAggregatedVideos(); - } + } filterCategories(): void { const selectedCategories = Object.keys(this.selectedCategories).filter(category => this.selectedCategories[category]); if (selectedCategories.includes("Todas")) { - this.filteredAggregatedVideos = this.aggregatedVideos; - }else if(selectedCategories.length === 0){ + this.categories.forEach(category => { + this.selectedCategories[category] = true; + }); + this.filteredAggregatedVideos = this.aggregatedVideos; + } else if ( + !selectedCategories.includes("Todas") && + this.selectedCategories["Todas"] === false && + selectedCategories.length === 8 + ) { + this.categories.forEach(category => { + this.selectedCategories[category] = false; + }); + this.filteredAggregatedVideos = []; + } else if(selectedCategories.length === 0){ this.filteredAggregatedVideos = []; - } - else{ - this.filteredAggregatedVideos = this.aggregatedVideos.filter(video => selectedCategories.includes(video.category)); + } else{ + this.filteredAggregatedVideos = this.aggregatedVideos.filter(video => selectedCategories.includes(video.category)); } this.sortAggregatedVideos(); } @@ -182,7 +196,7 @@ export class CategoryTableComponent { ]; ws['!cols'] = columnWidths; - XLSX.utils.book_append_sheet(wb, ws,'Sheet1'); + XLSX.utils.book_append_sheet(wb, ws,'Sheet1'); XLSX.writeFile(wb, this.fileName); } -} \ No newline at end of file +} From 00736b684b3c43d8b1ce9c8eab9c0f634ac03232 Mon Sep 17 00:00:00 2001 From: Luidooo Date: Thu, 22 Aug 2024 18:25:51 -0300 Subject: [PATCH 05/10] modificando o padrao de funcionamento do checkboz "todas" da categoria videos --- src/app/pages/catalog/catalog.component.ts | 16 ++++---- .../video-views/video-views.component.ts | 37 +++++++++++++------ 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/src/app/pages/catalog/catalog.component.ts b/src/app/pages/catalog/catalog.component.ts index af675074..677e5efa 100755 --- a/src/app/pages/catalog/catalog.component.ts +++ b/src/app/pages/catalog/catalog.component.ts @@ -80,16 +80,16 @@ export class CatalogComponent implements OnInit { if (this.isAuthenticated) { this.videoService.getFavoriteVideos(this.userId).subscribe({ next: (data) => { - + // Verifique se `videoList` existe e é um array if (data && Array.isArray(data.videoList)) { const favorite_videos_ids = data.videoList.map((item: any) => String(item.video_id)); // Converta IDs para string - + this.favoriteVideos = this.unbTvVideos.filter(video => favorite_videos_ids.includes(String(video.id))); // Converta IDs para string } else { console.warn('A estrutura da resposta da API não está conforme o esperado:', data); } - + this.filterVideos(); // Atualize a filtragem após carregar os vídeos de "favoritos" }, error: (error) => { @@ -111,16 +111,16 @@ export class CatalogComponent implements OnInit { if (this.isAuthenticated) { this.videoService.getWatchLaterVideos(this.userId).subscribe({ next: (data) => { - + // Verifique se `videoList` existe e é um array if (data && Array.isArray(data.videoList)) { const watchLaterVideoIds = data.videoList.map((item: any) => String(item.video_id)); // Converta IDs para string - + this.watchLaterVideos = this.unbTvVideos.filter(video => watchLaterVideoIds.includes(String(video.id))); // Converta IDs para string } else { console.warn('A estrutura da resposta da API não está conforme o esperado:', data); } - + this.filterVideos(); // Atualize a filtragem após carregar os vídeos de "assistir mais tarde" }, error: (error) => { @@ -137,7 +137,7 @@ export class CatalogComponent implements OnInit { this.filterVideos(); } } - + filterVideosByChannel(videos: IVideo[]): void { videos.forEach((video) => { @@ -156,7 +156,7 @@ export class CatalogComponent implements OnInit { const matchesDescription = this.filterTitle ? video.description?.toLowerCase().includes(this.filterTitle.toLowerCase()) : true; const matchesKeywords = this.filterTitle ? video.keywords?.toLowerCase().includes(this.filterTitle.toLowerCase()) : true; const matchesCatalog = this.filterTitle ? video.catalog?.toLowerCase().includes(this.filterTitle.toLowerCase()) : true; - + return isWatchLater && isFavorite && (matchesTitle || matchesDescription || matchesKeywords || matchesCatalog); }); } diff --git a/src/app/pages/video-views/video-views.component.ts b/src/app/pages/video-views/video-views.component.ts index c0d5333e..a3a0c2bc 100755 --- a/src/app/pages/video-views/video-views.component.ts +++ b/src/app/pages/video-views/video-views.component.ts @@ -34,7 +34,7 @@ export class VideoViewsComponent { "UnBTV", "Variedades" ]; - + sortAscending: boolean = true; isSorted: boolean = false; @@ -50,7 +50,9 @@ export class VideoViewsComponent { this.findAll(); this.filteredVideos = this.unbTvVideos; this.categories.forEach(category => this.selectedCategories[category] = false); - this.selectedCategories["Todas"] = true; + this.categories.forEach(category => { + this.selectedCategories[category] = true; + }); } findAll(): void { @@ -68,21 +70,21 @@ export class VideoViewsComponent { this.filterVideos(); }, }); - } + } cleanDescriptions() { const cleanHtml = (html:string) => { const doc = new DOMParser().parseFromString(html, 'text/html'); return doc.body.textContent ?? ""; }; - + this.unbTvVideos.forEach((video) => { if (video.description) { video.description = cleanHtml(video.description); } }); - } - + } + filterVideosByChannel(videos: IVideo[]): void { videos.forEach((video) => { @@ -95,13 +97,24 @@ export class VideoViewsComponent { filterVideos() { const selectedCategories = Object.keys(this.selectedCategories).filter(category => this.selectedCategories[category]); - + if (selectedCategories.includes("Todas")){ + this.categories.forEach(category => { + this.selectedCategories[category] = true; + }); this.filteredVideos = this.unbTvVideos; + }else if( + !selectedCategories.includes("Todas") && + selectedCategories.length === 8 + ){ + this.categories.forEach(category => { + this.selectedCategories[category] = false; + }); + }else if (selectedCategories.length === 0){ this.filteredVideos = []; }else{ - this.filteredVideos = this.unbTvVideos.filter(video => + this.filteredVideos = this.unbTvVideos.filter(video => (this.filterId ? video.id?.toString().includes(this.filterId) : true) && (this.filterTitle ? video.title?.toLowerCase().includes(this.filterTitle.toLowerCase()) : true) && (this.filterDescription ? video.description?.toLowerCase().includes(this.filterDescription.toLowerCase()) : true) && @@ -130,8 +143,8 @@ export class VideoViewsComponent { this.sortAscending = !this.sortAscending; this.sortVideos(); this.isSorted = true; - } - + } + logoutUser() { this.confirmationService.confirm({ message: 'Tem certeza que deseja sair?', @@ -144,7 +157,7 @@ export class VideoViewsComponent { reject: () => {}, }); } - + exportExcel() { let data = document.getElementById("tabela-videos"); const ws: XLSX.WorkSheet = XLSX.utils.table_to_sheet(data); @@ -159,7 +172,7 @@ export class VideoViewsComponent { ]; ws['!cols'] = columnWidths; - XLSX.utils.book_append_sheet(wb, ws,'Sheet1'); + XLSX.utils.book_append_sheet(wb, ws,'Sheet1'); XLSX.writeFile(wb, this.fileName); } } From 85e1301fa48cc3c1955c2c5d6ac396d292d0ba7f Mon Sep 17 00:00:00 2001 From: R-enanVieira Date: Fri, 23 Aug 2024 17:53:11 -0300 Subject: [PATCH 06/10] adicionando teste unitario para metodo de validacao de telefone --- .../suggest-agenda.component.spec.ts | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/app/pages/suggest-agenda/suggest-agenda.component.spec.ts b/src/app/pages/suggest-agenda/suggest-agenda.component.spec.ts index 9a61f144..4260edf7 100755 --- a/src/app/pages/suggest-agenda/suggest-agenda.component.spec.ts +++ b/src/app/pages/suggest-agenda/suggest-agenda.component.spec.ts @@ -1,6 +1,6 @@ import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { FormBuilder, ReactiveFormsModule } from '@angular/forms'; +import { FormBuilder, FormControl, ReactiveFormsModule } from '@angular/forms'; import { of, throwError } from 'rxjs'; import { EmailService } from 'src/app/services/email.service'; import { SuggestAgendaComponent } from './suggest-agenda.component'; @@ -64,6 +64,38 @@ describe('SuggestAgendaComponent', () => { expect(component.suggestAgendaForm).toBeTruthy(); }); + it('should return null for valid phone numbers', () => { + const validPhoneNumbers = [ + '(11) 91234-5678', + '(41) 912345678', + '(51)987654321', + '21 98765-4321', + '31923456789' + ]; + + validPhoneNumbers.forEach(phone => { + const control = new FormControl(phone); + const result = component.validacaoTelefone()(control); + expect(result).toBeNull(); + }); + }); + + it('should return an error object for invalid phone numbers', () => { + const invalidPhoneNumbers = [ + '129567890', + '(11) 1234-5678', + '(21) 087654321', + '98765-4321', + 'laskdjflkjas' + ]; + + invalidPhoneNumbers.forEach(phone => { + const control = new FormControl(phone); + const result = component.validacaoTelefone()(control); + expect(result).toEqual({ telefone_invalido: { value: phone } }); + }); + }); + it('should call sendSuggestAgenda method when the form is submitted', () => { fixture.detectChanges(); spyOn(component, 'sendSuggestAgenda').and.callThrough(); From b2beb77527a43fceca24d3a0271d363e3a3b0479 Mon Sep 17 00:00:00 2001 From: GabrielRoger07 Date: Sun, 25 Aug 2024 13:28:16 -0300 Subject: [PATCH 07/10] Ajuste posicao checkboxs catalogo --- src/app/pages/catalog/catalog.component.css | 10 +++------- src/app/pages/catalog/catalog.component.html | 21 ++++++++++---------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/src/app/pages/catalog/catalog.component.css b/src/app/pages/catalog/catalog.component.css index 0da50626..013af3ed 100755 --- a/src/app/pages/catalog/catalog.component.css +++ b/src/app/pages/catalog/catalog.component.css @@ -28,15 +28,11 @@ box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25); } -.first-checkbox { - margin-left: 5.625cm; /* Margem aplicada apenas ao primeiro checkbox */ -} .checkbox-container { - display: inline-flex; - justify-content: center; - /* align-items: center; */ - /* margin-left: 9.625em; /* Adiciona algum espaço entre o campo de pesquisa e a checkbox */ + margin: 1em 12em 0 12em; + display: flex; + justify-content:space-around; } diff --git a/src/app/pages/catalog/catalog.component.html b/src/app/pages/catalog/catalog.component.html index b8e99597..5d3da92f 100755 --- a/src/app/pages/catalog/catalog.component.html +++ b/src/app/pages/catalog/catalog.component.html @@ -1,16 +1,17 @@
- - - - +
+ + + +
From 6281dbd3c222f827a908e4aaff51fd1bcba0953c Mon Sep 17 00:00:00 2001 From: GabrielRoger07 Date: Sun, 25 Aug 2024 13:34:35 -0300 Subject: [PATCH 08/10] Correcao regex validacao telefone envio de pauta --- src/app/pages/suggest-agenda/suggest-agenda.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/pages/suggest-agenda/suggest-agenda.component.ts b/src/app/pages/suggest-agenda/suggest-agenda.component.ts index 48da39ed..3e48c18f 100755 --- a/src/app/pages/suggest-agenda/suggest-agenda.component.ts +++ b/src/app/pages/suggest-agenda/suggest-agenda.component.ts @@ -40,7 +40,7 @@ export class SuggestAgendaComponent implements OnInit { if (control.value == '') { return null; } - const padrao_telefone = /^\(?[1-9]{2}\)? ?(?:[2-8]|9[0-9])[0-9]{3}\-?[0-9]{4}$/; + const padrao_telefone = /^\d{8,15}$/; const valido = padrao_telefone.test(control.value); return valido ? null : { telefone_invalido: { value: control.value } }; } From ce315001e0d9351f3ee93686bf28fbc38c66853b Mon Sep 17 00:00:00 2001 From: GabrielRoger07 Date: Sun, 25 Aug 2024 13:39:03 -0300 Subject: [PATCH 09/10] Ajuste fonte dashboard --- .../pages/dashboard-category/dashboard-category.component.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/pages/dashboard-category/dashboard-category.component.css b/src/app/pages/dashboard-category/dashboard-category.component.css index e0c0c71f..536a9c7a 100644 --- a/src/app/pages/dashboard-category/dashboard-category.component.css +++ b/src/app/pages/dashboard-category/dashboard-category.component.css @@ -9,6 +9,10 @@ font-family: Helvetic, sans-serif; } +.containerCard, .containerLegenda, .containerGraficos { + font-size: 12px; +} + .containerPrincipal { display: flex; min-height: 100vh; From 6f252b6f973ef0cab28784f8736929a6ee2b18f6 Mon Sep 17 00:00:00 2001 From: GabrielRoger07 Date: Sun, 25 Aug 2024 13:53:30 -0300 Subject: [PATCH 10/10] Correcao e adicao de testes --- .../category-table.component.spec.ts | 7 +- .../suggest-agenda.component.spec.ts | 52 +-- .../suggest-agenda.component.ts | 2 +- .../video-views/video-views.component.spec.ts | 6 +- test-reports/TESTS.xml | 430 ++++++++++-------- 5 files changed, 254 insertions(+), 243 deletions(-) diff --git a/src/app/pages/category-table/category-table.component.spec.ts b/src/app/pages/category-table/category-table.component.spec.ts index 4b0455ad..74a09d09 100644 --- a/src/app/pages/category-table/category-table.component.spec.ts +++ b/src/app/pages/category-table/category-table.component.spec.ts @@ -72,13 +72,10 @@ describe('CategoryTableComponent', () => { it('should call findAll on ngOnInit', () => { spyOn(component, 'findAll'); component.ngOnInit(); + expect(component.findAll).toHaveBeenCalled(); component.categories.forEach(category => { - if (category === "Todas"){ - expect(component.selectedCategories[category]).toBeTrue() - }else{ - expect(component.selectedCategories[category]).toBeFalse() - } + expect(component.selectedCategories[category]).toBeTrue(); }); }); diff --git a/src/app/pages/suggest-agenda/suggest-agenda.component.spec.ts b/src/app/pages/suggest-agenda/suggest-agenda.component.spec.ts index 4260edf7..2d3da42d 100755 --- a/src/app/pages/suggest-agenda/suggest-agenda.component.spec.ts +++ b/src/app/pages/suggest-agenda/suggest-agenda.component.spec.ts @@ -64,38 +64,6 @@ describe('SuggestAgendaComponent', () => { expect(component.suggestAgendaForm).toBeTruthy(); }); - it('should return null for valid phone numbers', () => { - const validPhoneNumbers = [ - '(11) 91234-5678', - '(41) 912345678', - '(51)987654321', - '21 98765-4321', - '31923456789' - ]; - - validPhoneNumbers.forEach(phone => { - const control = new FormControl(phone); - const result = component.validacaoTelefone()(control); - expect(result).toBeNull(); - }); - }); - - it('should return an error object for invalid phone numbers', () => { - const invalidPhoneNumbers = [ - '129567890', - '(11) 1234-5678', - '(21) 087654321', - '98765-4321', - 'laskdjflkjas' - ]; - - invalidPhoneNumbers.forEach(phone => { - const control = new FormControl(phone); - const result = component.validacaoTelefone()(control); - expect(result).toEqual({ telefone_invalido: { value: phone } }); - }); - }); - it('should call sendSuggestAgenda method when the form is submitted', () => { fixture.detectChanges(); spyOn(component, 'sendSuggestAgenda').and.callThrough(); @@ -145,7 +113,7 @@ describe('SuggestAgendaComponent', () => { form.setValue({ descricao: 'Descrição', responsavel: 'Usuário Teste', - telefoneResponsavel: '(99) 99999-9999', + telefoneResponsavel: 999999999, tema: '', quando: '', local: '', @@ -155,4 +123,22 @@ describe('SuggestAgendaComponent', () => { component.sendSuggestAgenda(); expect(alertSpy).toHaveBeenCalledWith('error', 'Erro', 'Serviços válidos: Youtube, Google Drive, Microsoft Stream, Streamable e Vimeo.'); }); + + it('should handle invalid phone number error', () => { + fixture.detectChanges(); + const alertSpy = spyOn(alertService, 'showMessage'); + const form = component.suggestAgendaForm; + form.setValue({ + descricao: 'Descrição', + responsavel: 'Usuário Teste', + telefoneResponsavel: 99999-9999, + tema: '', + quando: '', + local: '', + emailContato: 'test@example.xxx', + urlVideo: 'https://www.youtube.com/watch?v=bX-8WWmW06Q' + }); + component.sendSuggestAgenda(); + expect(alertSpy).toHaveBeenCalledWith('error', 'Erro', 'Telefone inválido.'); + }); }); \ No newline at end of file diff --git a/src/app/pages/suggest-agenda/suggest-agenda.component.ts b/src/app/pages/suggest-agenda/suggest-agenda.component.ts index 3e48c18f..2d1250b2 100755 --- a/src/app/pages/suggest-agenda/suggest-agenda.component.ts +++ b/src/app/pages/suggest-agenda/suggest-agenda.component.ts @@ -83,7 +83,7 @@ export class SuggestAgendaComponent implements OnInit { }); } else { if(this.suggestAgendaForm.controls['telefoneResponsavel'].errors?.['telefone_invalido']){ - this.alertService.showMessage("error", "Erro", "Telefone inválido"); + this.alertService.showMessage("error", "Erro", "Telefone inválido."); } else if(this.suggestAgendaForm.controls['urlVideo'].errors?.['url_invalida']){ this.alertService.showMessage("error", "Erro", "Serviços válidos: Youtube, Google Drive, Microsoft Stream, Streamable e Vimeo."); }else{ diff --git a/src/app/pages/video-views/video-views.component.spec.ts b/src/app/pages/video-views/video-views.component.spec.ts index 8da9c716..52345cd3 100755 --- a/src/app/pages/video-views/video-views.component.spec.ts +++ b/src/app/pages/video-views/video-views.component.spec.ts @@ -71,11 +71,7 @@ describe('VideoViewsComponent', () => { expect(component.findAll).toHaveBeenCalled(); expect(component.filteredVideos).toEqual(component.unbTvVideos); component.categories.forEach(category => { - if (category === "Todas"){ - expect(component.selectedCategories[category]).toBeTrue() - }else{ - expect(component.selectedCategories[category]).toBeFalse() - } + expect(component.selectedCategories[category]).toBeTrue() }); }); diff --git a/test-reports/TESTS.xml b/test-reports/TESTS.xml index ee1e040d..6d2efc04 100644 --- a/test-reports/TESTS.xml +++ b/test-reports/TESTS.xml @@ -1,49 +1,49 @@ - + - + - + - + - + - - + + - + - - - + + + - - - - + + + + - - + + - - - + + + - + - - + + - + @@ -59,67 +59,69 @@ - - - - + - + + + + + + - - - + + + - - - - - + + + + + - - - - - - - - + + + + + + + + - - + + - + - - + + + - - - - - - - - - - - - + + + + + + + + + + + - + - + @@ -130,143 +132,147 @@ - - + + - + - + - - - - - + + + + + - + - - + + - - - + - + + + - - + + - + - + + + + + + + + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - + - + - - + + + + + + + + + + + + + + + + - - - + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - + - - + + -