import { describe, it, expect } from 'vitest';
import { isChapterRead } from './chapterProgress';

describe('isChapterRead', () => {
    it('marks chapters at or before the last-read number as read', () => {
        expect(isChapterRead(1, 3)).toBe(true);
        expect(isChapterRead(3, 3)).toBe(true);
    });

    it('leaves later chapters unread', () => {
        expect(isChapterRead(4, 3)).toBe(false);
    });

    it('marks nothing when the last-read position is unknown', () => {
        expect(isChapterRead(1, null)).toBe(false);
    });
});
