import { isSpam } from './detectSpam';
import { describe, it, expect } from 'vitest'

describe('isSpam function', () => {
  it('should classify a message containing a URL as spam', () => {
  const spamMessage = "Check out this site for amazing deals https://www.spamsite.com";
  const result = isSpam(spamMessage);
  expect(result).toBe(true);
  });

  it('should not classify a German message without a URL as spam', () => {
  const nonSpamMessage = "Das ist eine Nachricht ohne URL";
  const result = isSpam(nonSpamMessage);
  expect(result).toBe(false);
  });

  it('should not classify a English message without a URL as spam', () => {
    const nonSpamMessage = "Hi, this is some message";
    const result = isSpam(nonSpamMessage);
    expect(result).toBe(false);
  });

  it("should classify one word message as spam", () => {
      const spamMessage = 'yolo';
      const result = isSpam(spamMessage);
      expect(result).toBe(true)
  })
});