import { DyNTS_getArchivedDBName, DyNTS_archiveSuffix } from './archive.util'; describe('| DyNTS_getArchivedDBName', () => { it('| should append the archive suffix to the database name', () => { const dbName = 'TestDB'; const expectedArchivedName = `${dbName}_${DyNTS_archiveSuffix}`; expect(DyNTS_getArchivedDBName(dbName)).toBe(expectedArchivedName); }); it('| should return only the archive suffix when the database name is an empty string', () => { const dbName = ''; const expectedArchivedName = `_${DyNTS_archiveSuffix}`; expect(DyNTS_getArchivedDBName(dbName)).toBe(expectedArchivedName); }); it('| should handle database names with special characters', () => { const dbName = 'Test_DB-123!'; const expectedArchivedName = `${dbName}_${DyNTS_archiveSuffix}`; expect(DyNTS_getArchivedDBName(dbName)).toBe(expectedArchivedName); }); it('| should handle database names with spaces', () => { const dbName = 'Test DB Name'; const expectedArchivedName = `${dbName}_${DyNTS_archiveSuffix}`; expect(DyNTS_getArchivedDBName(dbName)).toBe(expectedArchivedName); }); it('| should handle database names with numbers', () => { const dbName = 'DB123'; const expectedArchivedName = `${dbName}_${DyNTS_archiveSuffix}`; expect(DyNTS_getArchivedDBName(dbName)).toBe(expectedArchivedName); }); it('| should handle very long database names', () => { const dbName = 'A'.repeat(100); const expectedArchivedName = `${dbName}_${DyNTS_archiveSuffix}`; expect(DyNTS_getArchivedDBName(dbName)).toBe(expectedArchivedName); }); it('| should use the correct archive suffix constant', () => { expect(DyNTS_archiveSuffix).toBe('archived'); const dbName = 'TestDB'; const result = DyNTS_getArchivedDBName(dbName); expect(result).toContain('archived'); expect(result).toBe('TestDB_archived'); }); }); describe('| DyNTS_archiveSuffix', () => { it('| should have the correct value', () => { expect(DyNTS_archiveSuffix).toBe('archived'); }); it('| should be a string', () => { expect(typeof DyNTS_archiveSuffix).toBe('string'); }); });