-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The problem is top-level scope isn't making it through
Test should now pass once I update ember-repl
- Loading branch information
1 parent
d1491df
commit 8596cd7
Showing
15 changed files
with
663 additions
and
355 deletions.
There are no files selected for viewing
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
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
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 |
---|---|---|
@@ -1 +1,9 @@ | ||
# `<APIDocs />` | ||
|
||
```hbs live | ||
<APIDocs | ||
@module="declarations/browser/re-exports" | ||
@name="APIDocs" | ||
@apiDocs="/docs/kolay.json" | ||
/> | ||
``` |
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 |
---|---|---|
@@ -1,5 +1,9 @@ | ||
# `createManifest(...)` | ||
|
||
<APIDocs | ||
@module="kolay/plugns/create-manifest/types" | ||
@name="CreateManifestOptions" /> | ||
```hbs live | ||
<APIDocs | ||
@module="kolay/plugns/create-manifest/types" | ||
@name="CreateManifestOptions" | ||
@apiDocs="/docs/kolay.json" | ||
/> | ||
``` |
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,23 @@ | ||
import { render } from '@ember/test-helpers'; | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
|
||
import { APIDocs } from 'kolay'; | ||
|
||
module('<APIDocs>', function (hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('it works', async function (assert) { | ||
await render( | ||
<template> | ||
<APIDocs | ||
@module="declarations/browser/re-exports" | ||
@name="APIDocs" | ||
@apiDocs="/docs/kolay.json" | ||
/> | ||
</template> | ||
); | ||
|
||
assert.dom().containsText('APIDocs'); | ||
}); | ||
}); |
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,109 @@ | ||
import { setOwner } from '@ember/owner'; | ||
import { render, visit, waitUntil } from '@ember/test-helpers'; | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
|
||
import { service } from 'ember-primitives/helpers'; | ||
import { use } from 'ember-resources'; | ||
import { addRoutes, Compiled } from 'kolay'; | ||
|
||
import { setupRouting } from 'ember-primitives/test-support'; | ||
|
||
module('Markdown | Rendering', function (hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('it works', async function (assert) { | ||
let doc = `# Hello there`; | ||
|
||
class Demo { | ||
@use doc = Compiled(() => doc); | ||
} | ||
|
||
let state = new Demo(); | ||
|
||
setOwner(state, this.owner); | ||
|
||
await render( | ||
<template> | ||
{{#if state.doc.component}} | ||
<state.doc.component /> | ||
{{/if}} | ||
</template> | ||
); | ||
|
||
await waitUntil(() => state.doc.isReady); | ||
|
||
assert.dom('h1').containsText('Hello there'); | ||
}); | ||
|
||
test('it renders a live codefence', async function (assert) { | ||
let doc = | ||
`# Hello there\n` + | ||
`\n` + | ||
'```hbs live no-shadow\n' + | ||
'<output>\n' + | ||
`\tgeneral kenobi\n\n` + | ||
'</output>\n' + | ||
'```\n'; | ||
|
||
class Demo { | ||
@use doc = Compiled(() => doc); | ||
} | ||
|
||
let state = new Demo(); | ||
|
||
setOwner(state, this.owner); | ||
|
||
await render( | ||
<template> | ||
{{#if state.doc.component}} | ||
<state.doc.component /> | ||
{{/if}} | ||
</template> | ||
); | ||
|
||
await waitUntil(() => state.doc.isReady); | ||
|
||
assert.dom('h1').containsText('Hello there'); | ||
assert.dom('output').containsText('general kenobi'); | ||
}); | ||
|
||
test('it renders a live codefence with one of the global components', async function (assert) { | ||
const Response = <template> | ||
<output>general kenobi</output> | ||
</template>; | ||
|
||
let doc = | ||
`# Hello there\n` + | ||
`\n` + | ||
'```hbs live no-shadow\n' + | ||
'\n' + | ||
'<hr>\n' + | ||
'<Response />\n' + | ||
'<hr>\n' + | ||
'```\n'; | ||
|
||
class Demo { | ||
@use doc = Compiled(() => doc, { | ||
topLevelScope: { Response }, | ||
}); | ||
} | ||
|
||
let state = new Demo(); | ||
|
||
setOwner(state, this.owner); | ||
|
||
await render( | ||
<template> | ||
{{#if state.doc.component}} | ||
<state.doc.component /> | ||
{{/if}} | ||
</template> | ||
); | ||
|
||
await waitUntil(() => state.doc.isReady); | ||
|
||
assert.dom('h1').containsText('Hello there'); | ||
assert.dom('output').containsText('general kenobi'); | ||
}); | ||
}); |
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,15 @@ | ||
{ | ||
"extends": "@tsconfig/ember/tsconfig.json", | ||
"glint": { | ||
"environment": ["ember-loose", "ember-template-imports"] | ||
}, | ||
"compilerOptions": { | ||
"skipLibCheck": true, | ||
"paths": { | ||
"docs-app/tests/*": ["./tests/*"], | ||
"docs-app/*": ["./app/*"], | ||
"*": ["./types/*"] | ||
} | ||
}, | ||
"include": ["./app/**/*", "./tests/**/*", "./types/**/*"] | ||
} |
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
Oops, something went wrong.