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;
|
||||
|
||||
Reference in New Issue
Block a user