(id: string)
| 35 | } |
| 36 | |
| 37 | byId(id: string): FakeElement | null { |
| 38 | if (this.id === id) return this; |
| 39 | for (const child of this.children) { |
| 40 | const found = child.byId(id); |
| 41 | if (found) return found; |
| 42 | } |
| 43 | return null; |
| 44 | } |
| 45 | |
| 46 | get text(): string { |
| 47 | return [this.textContent, ...this.children.map((child) => child.text)].join(" ").trim(); |