how to write test case for searchFilter data in angular material

How to write test case for below code

this is code

applyFilter(filterValue: string) {
    console.log("filter data"+filterValue)
    this.dataSource.filter = filterValue.trim().toLocaleLowerCase();
    if (this.paginator) {
      this.dataSource.paginator.firstPage();
    }

this is test code

it('should filter the product data applyFilter', () => {
    const mockProductData: any = require('../../../../../assets/mock-data/services/ProductMockData.json');
    spyOn(component, 'applyFilter');
    const filterData = '6875'
    expect(component.applyFilter(filterData)).toContain(mockProductData);
  }) 

Source: New feed
Source Url how to write test case for searchFilter data in angular material