Skip to content

Commit

Permalink
Add a demo card written in Ember
Browse files Browse the repository at this point in the history
  • Loading branch information
mixonic committed Jan 23, 2016
1 parent c4966fd commit 6a1015e
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 2 deletions.
4 changes: 4 additions & 0 deletions demo/app/components/ember-card-editor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Ember from 'ember';

export default Ember.Component.extend({
});
4 changes: 4 additions & 0 deletions demo/app/components/ember-card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import Ember from 'ember';

export default Ember.Component.extend({
});
4 changes: 3 additions & 1 deletion demo/app/mobiledoc-cards/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ import simpleCard from './dom/simple';
import selfieCard from './dom/selfie';
import imageCard from './dom/image';
import codemirrorCard from './dom/codemirror';
import createComponentCard from 'ember-mobiledoc-editor/utils/create-component-card';

export default [
inputCard,
simpleCard,
selfieCard,
imageCard,
codemirrorCard
codemirrorCard,
createComponentCard('ember-card')
];
13 changes: 12 additions & 1 deletion demo/app/mobiledocs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,16 @@ export default {
]]
]
]
}
},
emberCard: {
version: '0.2.0',
sections: [
[],
[
[1, 'p', [[[], 0, 'before']]],
[10, 'ember-card'],
[1, 'p', [[[], 0, 'after']]]
]
]
},
};
1 change: 1 addition & 0 deletions demo/app/templates/components/ember-card-editor.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Neato! An Ember card in edit mode!
1 change: 1 addition & 0 deletions demo/app/templates/components/ember-card.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Wowza, this card is rendered by Ember!
1 change: 1 addition & 0 deletions demo/app/templates/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<option value='blank'>Blank string</option>
<option value='simpleList'>List example</option>
<option value='simpleCard'>Simple Card</option>
<option value='emberCard'>Ember Card</option>
<option value='imageCard'>Image Card</option>
<option value='inputCard'>Card with Input</option>
<option value='selfieCard'>Selfie Card</option>
Expand Down
26 changes: 26 additions & 0 deletions demo/tests/integration/components/ember-card-editor-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('ember-card-editor', 'Integration | Component | ember card editor', {
integration: true
});

test('it renders', function(assert) {
assert.expect(2);

// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });

this.render(hbs`{{ember-card-editor}}`);

assert.equal(this.$().text().trim(), '');

// Template block usage:
this.render(hbs`
{{#ember-card-editor}}
template block text
{{/ember-card-editor}}
`);

assert.equal(this.$().text().trim(), 'template block text');
});
26 changes: 26 additions & 0 deletions demo/tests/integration/components/ember-card-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { moduleForComponent, test } from 'ember-qunit';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('ember-card', 'Integration | Component | ember card', {
integration: true
});

test('it renders', function(assert) {
assert.expect(2);

// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });

this.render(hbs`{{ember-card}}`);

assert.equal(this.$().text().trim(), '');

// Template block usage:
this.render(hbs`
{{#ember-card}}
template block text
{{/ember-card}}
`);

assert.equal(this.$().text().trim(), 'template block text');
});

0 comments on commit 6a1015e

Please sign in to comment.