Skip to content

Commit

Permalink
rm debuggers and add deno example to test folder
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed May 24, 2021
1 parent f1dcf53 commit a98299f
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 10 deletions.
1 change: 0 additions & 1 deletion examples/blog/dummy-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class MyComponent extends Component {

@action
increment(): void {
debugger;
this.count++;
}
}
Expand Down
1 change: 0 additions & 1 deletion packages/@emberx/link-to/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ export default class extends Component<{
get link() {
const targetModel = this.buildModel();

debugger;
return this.router.recognizer.generate(this.args.route, targetModel); // TODO: append queryParams
}

Expand Down
1 change: 0 additions & 1 deletion packages/@emberx/route/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export default class Route extends Component<{ model: object }> {

containerElement.innerHTML = ''; // TODO: temporary solution, clear previously rendered route

debugger;
renderComponent(this, {
element: containerElement,
args: { model: model || {} },
Expand Down
5 changes: 0 additions & 5 deletions packages/@emberx/test-helpers/lib/input/fill-in.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ export default async function fillIn(target: Target, text: string): Promise<void
}

const element = getElement(target) as Element | HTMLElement;
debugger;
if (!element) {
throw new Error(`Element not found when calling \`fillIn('${target}')\`.`);
} else if (typeof text === 'undefined' || text === null) {
throw new Error('Must provide `text` when calling `fillIn`.');
} else if (isFormControl(element)) {
debugger;
if (element.disabled) {
throw new Error(`Can not \`fillIn\` disabled '${target}'.`);
}
Expand All @@ -28,19 +26,16 @@ export default async function fillIn(target: Target, text: string): Promise<void
throw new Error(`Can not \`fillIn\` readonly '${target}'.`);
}

debugger;
guardForMaxlength(element, text, 'fillIn');

__focus__(element);

element.value = text;
} else if (isContentEditable(element)) {
debugger;
__focus__(element);

element.innerHTML = text;
} else {
debugger;
throw new Error('`fillIn` is only usable on form controls or contenteditable elements.');
}

Expand Down
1 change: 0 additions & 1 deletion packages/@emberx/test-helpers/lib/input/focus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { __blur__ } from './blur';
import { isFocusable, getElement } from './index';

export function __focus__(element: HTMLElement | Element | Document | SVGElement): void {
debugger;
if (!isFocusable(element)) {
throw new Error(`${element} is not focusable`);
}
Expand Down
1 change: 0 additions & 1 deletion packages/@emberx/test-helpers/lib/input/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ export function isContentEditable(element: Element): element is HTMLElementConte
const FORM_CONTROL_TAGS = ['INPUT', 'BUTTON', 'SELECT', 'TEXTAREA'];

export function isFormControl(element: Element | Document): element is FormControl {
debugger;
return (
!isDocument(element) &&
FORM_CONTROL_TAGS.indexOf(element.tagName) > -1 &&
Expand Down
29 changes: 29 additions & 0 deletions test/deno-render-component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
let { DOMParser, Element } = await import('https://deno.land/x/deno_dom/deno-dom-wasm.ts');
let { hbs, renderComponent } = await import('./packages/@emberx/component/dist/index.js');

const document = new DOMParser().parseFromString(
`
<h1>Hello World!</h1>
<div id="app"></div>
<p>Hello from <a href="https://deno.land/">Deno!</a></p>
`,
'text/html'
);

const element = document.getElementById('app');

window.HTMLElement = Element;
window.document = document;

console.log(renderComponent.toString());
renderComponent(lol, {
element: element,

owner: {
services: {
// locale: new LocaleService('en_US'),
},
},
});

console.log(document.getElementById('app').textContent);

0 comments on commit a98299f

Please sign in to comment.