AI Implementation feature(889): Admin Area General Settings and Categories 1.07 (#29)

This commit was merged in pull request #29.
Esse commit está contido em:
2026-07-22 14:53:01 +00:00
commit 282fcbab94
11 arquivos alterados com 359 adições e 115 exclusões
+18
Ver Arquivo
@@ -73,4 +73,22 @@ describe('Migrations', () => {
const restrict = fks.filter((f: any) => f.on_delete === 'RESTRICT');
expect(restrict.length).toBeGreaterThanOrEqual(2);
});
it('creates the category table with created_at and updated_at columns (Job 889)', async () => {
const cols: any[] = await dataSource.query(`PRAGMA table_info("category")`);
const names = new Set(cols.map((c: any) => c.name));
expect(names.has('created_at')).toBe(true);
expect(names.has('updated_at')).toBe(true);
});
it('lists categories without a "no such column: c.created_at" error (Job 889)', async () => {
const rows = await dataSource
.getRepository(CategoryEntity)
.createQueryBuilder('c')
.orderBy('LOWER(c.abbreviation)', 'ASC')
.addOrderBy('c.abbreviation', 'ASC')
.getMany();
expect(Array.isArray(rows)).toBe(true);
expect(rows.length).toBeGreaterThanOrEqual(6);
});
});