[Test] Fix mock text to make it compatible with method chaining (#5884)

This commit is contained in:
Sirz Benjie 2025-05-28 21:47:27 -05:00 committed by GitHub
parent d8c00616fc
commit 86fa3198fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -159,8 +159,8 @@ export default class MockText implements MockGameObject {
// return this.phaserText.addedToScene(); // return this.phaserText.addedToScene();
} }
setVisible(_visible) { setVisible(_visible): this {
// return this.phaserText.setVisible(visible); return this;
} }
setY(_y): this { setY(_y): this {
@ -209,9 +209,10 @@ export default class MockText implements MockGameObject {
return this; return this;
} }
setWordWrapWidth(width) { setWordWrapWidth(width): this {
// Sets the width (in pixels) to use for wrapping lines. // Sets the width (in pixels) to use for wrapping lines.
this.wordWrapWidth = width; this.wordWrapWidth = width;
return this;
} }
setFontSize(_fontSize): this { setFontSize(_fontSize): this {
@ -351,5 +352,6 @@ export default class MockText implements MockGameObject {
return this.runWordWrap(this.text).split("\n"); return this.runWordWrap(this.text).split("\n");
} }
// biome-ignore lint/complexity/noBannedTypes: This matches the signature of the class this mocks
on(_event: string | symbol, _fn: Function, _context?: any) {} on(_event: string | symbol, _fn: Function, _context?: any) {}
} }