feat: close the shift with a Thoreau quote in the end letterbox
This commit is contained in:
@@ -127,6 +127,45 @@ describe("SceneCanvas", () => {
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it("renders the closing quote word by word, inside the hidden world", async () => {
|
||||
const wrapper = mount(SceneCanvas, {
|
||||
props: {
|
||||
journey: journey(),
|
||||
policy: policy(),
|
||||
quality: "high",
|
||||
sceneDescription: "A decorative night road behind the portfolio content.",
|
||||
closer: {
|
||||
quote: "There is more day to dawn. The sun is but a morning star.",
|
||||
attribution: "Henry David Thoreau, Walden",
|
||||
},
|
||||
},
|
||||
});
|
||||
await flushPromises();
|
||||
|
||||
const words = wrapper.findAll(".journey-world__word");
|
||||
expect(words.map((w) => w.text()).join(" ")).toBe(
|
||||
"There is more day to dawn. The sun is but a morning star.",
|
||||
);
|
||||
expect(words[3]!.attributes("style")).toContain("--i: 3");
|
||||
expect(wrapper.get(".journey-world__by").text()).toBe("Henry David Thoreau, Walden");
|
||||
expect(wrapper.get(".journey-world").element.contains(wrapper.get(".journey-world__credit").element)).toBe(true);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it("omits the closing quote when the content has none", async () => {
|
||||
const wrapper = mount(SceneCanvas, {
|
||||
props: {
|
||||
journey: journey(),
|
||||
policy: policy(),
|
||||
quality: "high",
|
||||
sceneDescription: "A decorative night road behind the portfolio content.",
|
||||
},
|
||||
});
|
||||
await flushPromises();
|
||||
expect(wrapper.find(".journey-world__credit").exists()).toBe(false);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it("forwards each complete scene frame interval to adaptive quality", async () => {
|
||||
const callbacks = new Map<number, FrameRequestCallback>();
|
||||
let nextFrameId = 1;
|
||||
|
||||
@@ -113,6 +113,16 @@ describe('content schemas', () => {
|
||||
.toThrow(/unmanifested asset reference: missing-soundtrack/i);
|
||||
});
|
||||
|
||||
it('accepts an optional closer quote and rejects stray or empty fields', () => {
|
||||
const content = cloneContent() as Record<string, unknown>;
|
||||
content.closer = { quote: 'There is more day to dawn.', attribution: 'Henry David Thoreau, Walden' };
|
||||
expect(parsePortfolioContent(content).closer?.attribution).toBe('Henry David Thoreau, Walden');
|
||||
content.closer = { quote: '', attribution: 'Henry David Thoreau, Walden' };
|
||||
expect(() => parsePortfolioContent(content)).toThrow();
|
||||
content.closer = { quote: 'x', attribution: 'y', extra: 1 };
|
||||
expect(() => parsePortfolioContent(content)).toThrow();
|
||||
});
|
||||
|
||||
it('requires audio assets to have null dimensions and a positive duration', () => {
|
||||
const audio = {
|
||||
id: 'soundtrack-main-opus',
|
||||
|
||||
Reference in New Issue
Block a user