0

I have upgraded my project from angular 12 to angular 13 and I am using ngx-bootstrap for dropdown and popover but when I ran my unittest I am getting this error.

this is my nix-bootstrap version "ngx-bootstrap": "^6.2.0",

this is my module file

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FilterComponent } from './filter.component';
import { FormsModule } from '@angular/forms';
import { BsDropdownModule } from 'ngx-bootstrap/dropdown';
import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
import { PopoverModule } from 'ngx-bootstrap/popover';



@NgModule({
  declarations: [FilterComponent],
  imports: [
    CommonModule,
    FormsModule,
    DateRangePickerPopoverModule,
    BsDropdownModule.forRoot(),
    BrowserAnimationsModule,
    BsDatepickerModule.forRoot(),
    PopoverModule.forRoot(),
  ],
  exports: [FilterComponent]
})
export class FilterModule { }

this is my component file

import { Component, OnInit, Input, EventEmitter, Output, ViewChild, HostListener, ElementRef } from '@angular/core';

@Component({
  selector: 'app-filter',
  templateUrl: './filter.component.pug',
  styleUrls: ['./filter.component.scss']
})
export class FilterComponent implements OnInit {
  @Input() isRadioFilters = false;
  @Input() isCheckboxFilters = false;
  @Input() radioFilter = 'all';
  @Input() rehireStatusFilters: any[] = [];
  @Input() dateFilters = {};
  @Input() filterByOptions = [{'key': 'Requested date', 'value': $localize`Requested date`}, {'key': 'Employment end date', 'value': $localize`Employment end date`}];
  @Input() start!: any;
  @Input() end!: any;
  @Input() filterBy = '';
  @Input() filter = 'All';
  @Input() filterRadioTitle = '';
  @Input() filterRadioOptions: any[] = [];
  @Input() filterCheckboxTitle = '';
  @Input() filterCheckboxOptions: any[] = [];
  @Output() filterUpdate = new EventEmitter();
  @ViewChild('dateFilter', {static: false}) filterDropdown: any;

this is my pug file where I am using the bs-dropdown/bs-popover

button.btn.btn-outline-light.text-dark.filter-button.p-0.pl-3.pr-3.bg-white(
        '[popover]'="filters",
        placement="bottom right",
        '[ngClass]'="filter !=='All' ? 'date-button': ''",
         #dateFilter="bs-popover"
         containerClass="custom-popover"
    )
        span('*ngIf'="filter === 'All'")
          span.btn-img
              img(src="https://assets.xref.com/omni/shared/filter_icon.svg")
          span(i18n) Filters
        span('*ngIf'="filter !== 'All'")
          img(src='https://assets.xref.com/omni/shared/calendar_icon.svg')
          span.ml-2 {{startStr}} - {{endStr}}

expecting it to be working fine as I was working fine, but now I am getting undefined when running the unittest

0 Answers0