Files
gameno-dashboard/src/utils/classSchedule.test.js
T
kavehhn 91527e64bb feat(classes): add class days and meeting times to class forms
Let admins set the weekly schedule on the class and show it in lists, details, and session generation.
2026-08-15 23:59:08 +03:30

23 lines
808 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { describe, it } from 'node:test';
import assert from 'node:assert/strict';
import { formatClassDays, formatClassTime, formatClassSchedule } from './classSchedule.js';
describe('class schedule display', () => {
it('formats weekdays in Iran week order', () => {
assert.equal(formatClassDays([1, 6]), 'شنبه و دوشنبه');
});
it('formats start and end times', () => {
assert.equal(formatClassTime('19:00', '21:00'), '19:00 21:00');
assert.equal(formatClassTime('19:00', ''), '19:00');
});
it('joins days and time for a class schedule label', () => {
assert.equal(
formatClassSchedule({ days: [6, 1], startTime: '19:00', endTime: '21:00' }),
'شنبه و دوشنبه | 19:00 21:00'
);
assert.equal(formatClassSchedule({}), '');
});
});