how can I write a test case for below code in spec.ts file

flexifilterDropDownSelect(listName) {
    if (this.showDropdownList && listName === this.previousListName) {
        this.showDropdownList = false;
        this.showArrow = false;
    }

this should be written as a test case in spec.ts file. Kindly help