forked from webcomponents/custom-elements-everywhere
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Failed attempts at getting an aurelia component tested
Relates to webcomponents#50
- Loading branch information
Showing
9 changed files
with
63 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"presets": [ | ||
"./.babelrc.js" | ||
] | ||
} |
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,7 @@ | ||
// this file will be used by default by babel@7 once it is released | ||
module.exports = { | ||
"plugins": [ | ||
"transform-decorators-legacy", | ||
"transform-class-properties" | ||
] | ||
} |
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,10 +1,23 @@ | ||
//import 'aurelia-loader-webpack'; | ||
import expect from "expect"; | ||
import { bootstrap } from 'aurelia-bootstrapper'; | ||
import { StageComponent } from 'aurelia-testing'; | ||
|
||
describe("basic support", function() { | ||
describe("no children", function() { | ||
it("can display a Custom Element with no children", function() { | ||
this.weight = 3; | ||
expect(true).toBe(true); | ||
}); | ||
describe('MyComponent', function() { | ||
this.timeout(15000); | ||
|
||
it('should render first name', function(done) { | ||
let component = StageComponent | ||
.withResources('src/my-component') | ||
.inView('<my-component first-name.bind="firstName"></my-component>') | ||
.boundTo({ firstName: 'Bob' }); | ||
|
||
component.create(bootstrap) | ||
.then(() => { | ||
const nameElement = document.querySelector('.firstName'); | ||
expect(nameElement.innerHTML).toBe('Bob'); | ||
done(); | ||
}) | ||
.catch(e => { console.log(e.toString()) }); | ||
}); | ||
}); |
Empty file.
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,3 @@ | ||
<template> | ||
<div class="firstName">${firstName}</div> | ||
</template> |
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,5 @@ | ||
import {bindable} from 'aurelia-framework'; | ||
|
||
export class MyComponent { | ||
@bindable firstName; | ||
} |
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