File tree Expand file tree Collapse file tree
packages/core/test/acceptance Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -324,12 +324,18 @@ describe('control flow - switch', () => {
324324 } ) ;
325325
326326 it ( 'should support an empty case block' , ( ) => {
327+ // prettier-ignore
327328 @Component ( {
328329 template : `
329330 @switch (case) {
330331 @case (0) {}
331- @case (1) {
332- case 1
332+ @case (1) { <!-- empty --> }
333+ @case (2) {
334+
335+ }
336+ @case(3)
337+ @case (4) {
338+ case 3-4
333339 }
334340 @default {
335341 default
@@ -348,7 +354,19 @@ describe('control flow - switch', () => {
348354
349355 fixture . componentInstance . case = 1 ;
350356 fixture . detectChanges ( ) ;
351- expect ( fixture . nativeElement . textContent ) . toBe ( ' case 1 ' ) ;
357+ expect ( fixture . nativeElement . textContent ) . toBe ( '' ) ;
358+
359+ fixture . componentInstance . case = 2 ;
360+ fixture . detectChanges ( ) ;
361+ expect ( fixture . nativeElement . textContent ) . toBe ( '' ) ;
362+
363+ fixture . componentInstance . case = 3 ;
364+ fixture . detectChanges ( ) ;
365+ expect ( fixture . nativeElement . textContent ) . toBe ( ' case 3-4 ' ) ;
366+
367+ fixture . componentInstance . case = 4 ;
368+ fixture . detectChanges ( ) ;
369+ expect ( fixture . nativeElement . textContent ) . toBe ( ' case 3-4 ' ) ;
352370
353371 fixture . componentInstance . case = 5 ;
354372 fixture . detectChanges ( ) ;
You can’t perform that action at this time.
0 commit comments