From f4c21839ce5f1b080ac32aee283f98f95b5adee3 Mon Sep 17 00:00:00 2001 From: Jonathan Johnson Date: Wed, 23 Mar 2016 21:55:44 -0700 Subject: [PATCH] Add location to single event --- addon/components/ilios-calendar-single-event.js | 1 + .../templates/components/ilios-calendar-single-event.hbs | 1 + tests/dummy/app/controllers/application.js | 1 + tests/dummy/app/templates/application.hbs | 3 ++- .../components/ilios-calendar-single-event-test.js | 9 +++++++++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/addon/components/ilios-calendar-single-event.js b/addon/components/ilios-calendar-single-event.js index c0994d2..3d97a7b 100644 --- a/addon/components/ilios-calendar-single-event.js +++ b/addon/components/ilios-calendar-single-event.js @@ -12,6 +12,7 @@ export default Component.extend({ sessionTitle: null, description: null, offeredAtPhrase: null, + location: null, taughtByPhrase: null, sessionIsPhrase: null, noContentPhrase: 'None', diff --git a/addon/templates/components/ilios-calendar-single-event.hbs b/addon/templates/components/ilios-calendar-single-event.hbs index 55341c1..8bf7e91 100644 --- a/addon/templates/components/ilios-calendar-single-event.hbs +++ b/addon/templates/components/ilios-calendar-single-event.hbs @@ -6,6 +6,7 @@ {{courseTitle}} - {{sessionTitle}}
{{offeredAtPhrase}}
+
{{location}}
{{#if taughtByPhrase}}
{{taughtByPhrase}}
{{/if}} diff --git a/tests/dummy/app/controllers/application.js b/tests/dummy/app/controllers/application.js index 997162f..8813238 100644 --- a/tests/dummy/app/controllers/application.js +++ b/tests/dummy/app/controllers/application.js @@ -103,6 +103,7 @@ export default Controller.extend({ courseTitle: 'Fake Event', sessionTitle: 'Fake Event', offeredAtPhrase: 'On ' + moment(event.startDate).format('dddd, MMMM Do YYYY, h:mm a'), + location: event.location, taughtByPhrase: 'Taught By Barry Bods, Neil deGrasse Tyson', sessionIs: 'Session is "lecture"', courseObjectives: [ diff --git a/tests/dummy/app/templates/application.hbs b/tests/dummy/app/templates/application.hbs index 6b8638d..8c268fe 100644 --- a/tests/dummy/app/templates/application.hbs +++ b/tests/dummy/app/templates/application.hbs @@ -1,6 +1,6 @@

Demo of ilios-calendar

{{#unless fakeSingleEvent}} - {{ilios-calendar + {{ilios-calendar calendarEventsPromise=calendarEventsPromise selectedView=selectedView selectedDate=selectedDate @@ -15,6 +15,7 @@ courseTitle=fakeSingleEvent.courseTitle sessionTitle=fakeSingleEvent.sessionTitle offeredAtPhrase=fakeSingleEvent.offeredAtPhrase + location=fakeSingleEvent.location sessionIsPhrase=fakeSingleEvent.sessionIsPhrase taughtByPhrase=fakeSingleEvent.taughtByPhrase courseObjectives=fakeSingleEvent.courseObjectives diff --git a/tests/integration/components/ilios-calendar-single-event-test.js b/tests/integration/components/ilios-calendar-single-event-test.js index 56c6220..e1cd1ee 100644 --- a/tests/integration/components/ilios-calendar-single-event-test.js +++ b/tests/integration/components/ilios-calendar-single-event-test.js @@ -68,3 +68,12 @@ test('taughtBy does not display', function(assert) { assert.ok(isEmpty(this.$('.ilios-calendar-single-event-instructors'))); }); + +test('setting location changes display', function(assert) { + assert.expect(1); + this.render(hbs`{{ilios-calendar-single-event location='Room 1b' + courseObjectives=courseObjectives + sessionObjectives=sessionObjectives + }}`); + assert.notEqual(this.$().text().trim().search(/Room 1b/), -1); +});