From 97ecb176370bbccdc7d563cee6eb4af42f716b67 Mon Sep 17 00:00:00 2001 From: Sirz Benjie <142067137+SirzBenjie@users.noreply.github.com> Date: Sun, 6 Apr 2025 18:01:17 -0500 Subject: [PATCH] Add getWrappedText to mockText --- test/testUtils/mocks/mocksContainer/mockText.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/testUtils/mocks/mocksContainer/mockText.ts b/test/testUtils/mocks/mocksContainer/mockText.ts index 552f8ff3ff8..1f3f0ad792f 100644 --- a/test/testUtils/mocks/mocksContainer/mockText.ts +++ b/test/testUtils/mocks/mocksContainer/mockText.ts @@ -308,5 +308,14 @@ export default class MockText implements MockGameObject { return this.list; } + /** + * Runs the word wrap algorithm on the text, then returns an array of the lines + */ + getWrappedText() { + // Returns the wrapped text. + // return this.phaserText.getWrappedText(); + return this.runWordWrap(this.text).split("\n"); + } + on(_event: string | symbol, _fn: Function, _context?: any) {} }