The full CI run on 4c7861b had two red checks. Neither showed when
only the touched modules ran, because each needs a module before it.
- e2e 40c-iii (#347): a stroke on a tilemap drew the captions
"Comment" and "Held" again. They are a note and a group that e2e 36
leaves in a graph. AnnotationView gave its caption a new TextStyle
on every redraw, and Pixi draws a text again for a new style. The
graph redraws on every edit of the project. The caption now keeps
its style while colour and width stay the same.
- e2e 49a: a plain user deleting a shared file got 404 instead of
403. Since #344 the DELETE route asked whether the file exists
before whose it is. It now refuses a stranger first, so another
folder tells them nothing. The wiki's API page says so.
Tests:
- Unit annotation-view (new): 2 green, counter-check 1 red
- e2e 36,39,40,49 (melektaus-atx): both checks green, 49 then hit a
harness timeout (CDP Network.enable) once
- e2e 49 alone (melektaus-atx): ALL PASSED - 22 checks
- Gate (melektaus-atx): CHECK EXIT 0, 261 files, 4040 tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
1.5 KiB
TypeScript
36 lines
1.5 KiB
TypeScript
/**
|
|
* A graph draws its groups and comments again on every edit of the project, a stroke on a tilemap
|
|
* included. A caption that is given a new style is drawn again as text, so it keeps its style for as
|
|
* long as colour and width stay the same (#347).
|
|
*/
|
|
import type { Text } from 'pixi.js';
|
|
import { describe, expect, it } from 'vitest';
|
|
import { AnnotationView } from '../../src/editor/graph/AnnotationView';
|
|
|
|
const note = { id: 'n1', x: 0, y: 0, w: 200, h: 120, text: 'Comment' };
|
|
const captionOf = (view: AnnotationView) => view.children[1] as Text;
|
|
|
|
describe('the caption of a group or comment', () => {
|
|
// A comment only: a group's title is cut to its width by measuring it, which needs a canvas. The
|
|
// groups are seen in the browser, in e2e 40c-iii.
|
|
it('keeps its style through a redraw that changes nothing', () => {
|
|
const view = new AnnotationView({ ...note }, 'note');
|
|
const style = captionOf(view).style;
|
|
view.redraw();
|
|
view.sync({ ...note });
|
|
expect(captionOf(view).style).toBe(style);
|
|
});
|
|
|
|
it('is given a new style for a new width or colour', () => {
|
|
const view = new AnnotationView({ ...note }, 'note');
|
|
const style = captionOf(view).style;
|
|
view.sync({ ...note, w: 260 });
|
|
const wider = captionOf(view).style;
|
|
expect(wider).not.toBe(style);
|
|
expect(wider.wordWrapWidth).toBe(260 - 16);
|
|
view.sync({ ...note, w: 260, color: 0xffffff });
|
|
expect(captionOf(view).style).not.toBe(wider);
|
|
expect(captionOf(view).style.fill).not.toBe(wider.fill);
|
|
});
|
|
});
|