Open History to see the last commit
1import { describe, expect, it } from "vite-plus/test";
2
3import { createAnnotationIdSource } from "./AnnotationIds.ts";
4
5describe("createAnnotationIdSource", () => {
6 it("gives annotations picked on separate page loads distinct ids", () => {
7 // The picker preload runs afresh on every page load, while the composer
8 // keeps earlier annotations keyed by id.
9 const firstLoad = createAnnotationIdSource();
10 firstLoad("element");
11 const firstAnnotation = firstLoad("annotation");
12
13 const secondLoad = createAnnotationIdSource();
14 secondLoad("element");
15 const secondAnnotation = secondLoad("annotation");
16
17 expect(secondAnnotation).not.toBe(firstAnnotation);
18 });
19});