-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
addresses #330
- Loading branch information
Showing
5 changed files
with
80 additions
and
5 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
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,19 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
import { render } from '@ember/test-helpers'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
// import { selectChoose } from 'ember-power-select/test-support'; | ||
import { setupFactoryGuy, make } from 'ember-data-factory-guy'; | ||
|
||
module('Integration | Component | doi geo-location', function(hooks) { | ||
setupRenderingTest(hooks); | ||
setupFactoryGuy(hooks); | ||
|
||
test('it renders', async function(assert) { | ||
this.set('model', make('doi')); | ||
this.set('fragment', make('geoLocation')); | ||
await render(hbs`{{doi-geo-location model=model fragment=fragment index=0}}`); | ||
|
||
assert.dom('*').hasText('GeoLocation Place (optional) Description of a geographic location.'); | ||
}); | ||
}); |
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,34 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
import { setupFactoryGuy, make } from 'ember-data-factory-guy'; | ||
import { render, fillIn, click } from '@ember/test-helpers'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
|
||
module('Integration | Component | doi geo-locations', function(hooks) { | ||
setupRenderingTest(hooks); | ||
setupFactoryGuy(hooks); | ||
|
||
test('it renders', async function(assert) { | ||
this.set('model', make('doi')); | ||
await render(hbs`{{doi-geo-locations model=model}}`); | ||
await click('#add-geolocation'); | ||
let geoLocations = this.element.querySelectorAll('input.geo-location-place-field'); | ||
|
||
await fillIn(geoLocations[0], 'Chihuahahu, Mexico, 1890'); | ||
assert.dom(geoLocations[0]).hasValue('Chihuahahu, Mexico, 1890'); | ||
}); | ||
|
||
test('add multiple values', async function(assert) { | ||
this.set('model', make('doi')); | ||
await render(hbs`{{doi-geo-locations model=model}}`); | ||
await click('#add-geolocation'); | ||
await click('#add-geolocation'); | ||
let geoLocations = this.element.querySelectorAll('input.geo-location-place-field'); | ||
|
||
await fillIn(geoLocations[0], 'motzstrasse 56, berlin'); | ||
await fillIn(geoLocations[1], 'Chihuahahu, Mexico, 1890'); | ||
|
||
assert.dom(geoLocations[0]).hasValue('motzstrasse 56, berlin'); | ||
assert.dom(geoLocations[1]).hasValue('Chihuahahu, Mexico, 1890'); | ||
}); | ||
}); |