16 lines
552 B
JavaScript
16 lines
552 B
JavaScript
import { describe, it, expect } from 'vitest';
|
|
import { mapCurrentStatusToG5Code } from '../src/db/g5DatabaseManager.js';
|
|
|
|
describe('G5 current_status mapping', () => {
|
|
it('maps on/off/restart to numeric codes', () => {
|
|
expect(mapCurrentStatusToG5Code('on')).toBe(1);
|
|
expect(mapCurrentStatusToG5Code('off')).toBe(2);
|
|
expect(mapCurrentStatusToG5Code('restart')).toBe(3);
|
|
});
|
|
|
|
it('returns 0 for unknown values', () => {
|
|
expect(mapCurrentStatusToG5Code('idle')).toBe(0);
|
|
expect(mapCurrentStatusToG5Code(null)).toBe(0);
|
|
});
|
|
});
|