[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();
}
setVisible(_visible) {
// return this.phaserText.setVisible(visible);
setVisible(_visible): this {
return this;
}
setY(_y): this {
@ -209,9 +209,10 @@ export default class MockText implements MockGameObject {
return this;
}
setWordWrapWidth(width) {
setWordWrapWidth(width): this {
// Sets the width (in pixels) to use for wrapping lines.
this.wordWrapWidth = width;
return this;
}
setFontSize(_fontSize): this {
@ -351,5 +352,6 @@ export default class MockText implements MockGameObject {
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) {}
}