import { expect, test } from 'bun:test';
import path from 'path';
import fs from 'fs';
import { fetchEventContentHTML, fetchEventListHTML } from '../src/utils/';

test('load html', async () => {
  const saveTo = path.resolve(__dirname, 'data', 'view-event.html');
  const html = await fetchEventListHTML(`47`);
  fs.writeFileSync(saveTo, html?? '');
  expect(html?.length).not.toBe(0);
});

test('load html', async () => {
  const saveTo = path.resolve(__dirname, 'data', 'view-event-content.html');
  const html = await fetchEventContentHTML('167684');
  fs.writeFileSync(saveTo, html?? '');
  expect(html?.length).not.toBe(0);
});