import { matchKeyword } from './string-match.util';
import { stringMatchFixtures } from '@test-fixtures/common/string-match.fixture';

describe('matchKeyword', () => {
  it('matches regardless of whitespace and case', () => {
    for (const matchCase of stringMatchFixtures.matchCases) {
      expect(matchKeyword(matchCase.input, matchCase.keyword)).toBe(
        matchCase.expected,
      );
    }
  });

  it('returns false when keyword is not present', () => {
    expect(
      matchKeyword(
        stringMatchFixtures.noMatchCase.input,
        stringMatchFixtures.noMatchCase.keyword,
      ),
    ).toBe(stringMatchFixtures.noMatchCase.expected);
  });
});
