import 'mocha' ; import { expect } from 'chai' ; import { FilterResult } from '@/application/Context/State/Filter/FilterResult' ; import { CategoryStub } from '@tests/unit/stubs/CategoryStub' ; import { ScriptStub } from '@tests/unit/stubs/ScriptStub' ; describe ( 'FilterResult' , ( ) => { describe ( 'hasAnyMatches' , ( ) => { it ( 'false when no matches' , ( ) => { const sut = new FilterResult ( [ ] , [ ] , 'query' ) ; const actual = sut . hasAnyMatches ( ) ; expect ( actual ) . to . equal ( false ) ; } ) ; it ( 'true when script matches' , ( ) => { const sut = new FilterResult ( [ new ScriptStub ( 'id' ) ] , [ ] , 'query' ) ; const actual = sut . hasAnyMatches ( ) ; expect ( actual ) . to . equal ( true ) ; } ) ; it ( 'true when category matches' , ( ) => { const sut = new FilterResult ( [ ] , [ new CategoryStub ( 5 ) ] , 'query' ) ; const actual = sut . hasAnyMatches ( ) ; expect ( actual ) . to . equal ( true ) ; } ) ; it ( 'true when script + category matches' , ( ) => { const sut = new FilterResult ( [ new ScriptStub ( 'id' ) ] , [ new CategoryStub ( 5 ) ] , 'query' ) ; const actual = sut . hasAnyMatches ( ) ; expect ( actual ) . to . equal ( true ) ; } ) ; } ) ; } ) ;