Skip to content

Commit

Permalink
fix cypress test for vanilla-es6 (tastejs#1907)
Browse files Browse the repository at this point in the history
  • Loading branch information
gj262 authored and samccone committed Jul 1, 2018
1 parent 32ee33e commit 302b409
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 15 deletions.
3 changes: 2 additions & 1 deletion cypress/integration/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ const badLocalStorageFormat = {
const blurAfterType = {
ampersand: true,
dijon: true,
duel: true
duel: true,
'vanilla-es6': true
}

// add after typing if `...{enter}` is not enough for some frameworks
Expand Down
63 changes: 57 additions & 6 deletions examples/vanilla-es6/dist/bundle.js

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion examples/vanilla-es6/node_modules/todomvc-app-css/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/vanilla-es6/node_modules/todomvc-common/base.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/vanilla-es6/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"scripts": {
"compile": "java -jar node_modules/google-closure-compiler/compiler.jar -O ADVANCED --language_in=ES6_STRICT --new_type_inf --js_output_file='dist/bundle.js' 'src/**.js' -W VERBOSE",
"compile": "java -jar node_modules/google-closure-compiler/compiler.jar --language_in=ES6_STRICT --new_type_inf --js_output_file='dist/bundle.js' 'src/**.js' -W VERBOSE",
"prepublish": "npm run compile"
},
"dependencies": {
Expand Down
8 changes: 5 additions & 3 deletions examples/vanilla-es6/src/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ export default class Template {
itemList(items) {
return items.reduce((a, item) => a + `
<li data-id="${item.id}"${item.completed ? ' class="completed"' : ''}>
<input class="toggle" type="checkbox" ${item.completed ? 'checked' : ''}>
<label>${escapeForHTML(item.title)}</label>
<button class="destroy"></button>
<div class="view">
<input class="toggle" type="checkbox" ${item.completed ? 'checked' : ''}>
<label>${escapeForHTML(item.title)}</label>
<button class="destroy"></button>
</div>
</li>`, '');
}

Expand Down
4 changes: 2 additions & 2 deletions examples/vanilla-es6/src/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {ItemList} from './item';
import {qs, $on, $delegate} from './helpers';
import Template from './template';

const _itemId = element => parseInt(element.parentNode.dataset.id, 10);
const _itemId = element => parseInt(element.parentNode.dataset.id || element.parentNode.parentNode.dataset.id, 10);
const ENTER_KEY = 13;
const ESCAPE_KEY = 27;

Expand Down Expand Up @@ -30,7 +30,7 @@ export default class View {
* @param {!Element} target Target Item's label Element
*/
editItem(target) {
const listItem = target.parentElement;
const listItem = target.parentElement.parentElement;

listItem.classList.add('editing');

Expand Down

0 comments on commit 302b409

Please sign in to comment.