-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1710 from glimmerjs/reproduce-problem-from-ember
Fix rendering non-object, yet stringable values (Symbol?), moves Reflect.getPrototypeOf to Object.getPrototypeOf
- Loading branch information
Showing
2 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
packages/@glimmer-workspace/integration-tests/test/render-test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { defineComponent, jitSuite, RenderTest, test } from '@glimmer-workspace/integration-tests'; | ||
|
||
class RenderingTest extends RenderTest { | ||
static suiteName = '<rendering>'; | ||
|
||
query(selector: string) { | ||
let el = (s: string) => (this.element as unknown as HTMLElement).querySelector(s); | ||
return el(selector) as Element; | ||
} | ||
|
||
@test | ||
'Symbols are rendered as strings'() { | ||
const sym = Symbol('hello world'); | ||
const Bar = defineComponent({ sym }, '<div>{{sym}}</div>'); | ||
|
||
this.renderComponent(Bar); | ||
this.assertHTML(`<div>Symbol(hello world)</div>`); | ||
} | ||
} | ||
|
||
jitSuite(RenderingTest); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters