import assert from 'node:assert/strict';
import { describe, it } from 'node:test';

import { seederGlob, seedStorage } from '@/db/umzug';

describe('umzug storage', () => {
  it('tracks seeders in the dedicated SequelizeData model and table', () => {
    const model = seedStorage.getModel();

    assert.equal(seedStorage.modelName, 'SequelizeData');
    assert.equal(seedStorage.tableName, 'SequelizeData');
    assert.equal(model.tableName, 'SequelizeData');
  });

  it('loads timestamped seed files only', () => {
    assert.equal(seederGlob, 'seeders/[0-9]*.{ts,js}');
    assert.equal(seederGlob.includes('*.test'), false);
  });
});
