Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

Commit

Permalink
Merge pull request #197 from Financial-Times/revert-196-matth/use-pro…
Browse files Browse the repository at this point in the history
…motional-standfirst

Revert "Use promotional standfirst"
  • Loading branch information
GlynnPhillips committed Aug 3, 2018
2 parents 5af8b35 + 965a1a7 commit b83fdb4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/presenters/teaser-presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,9 @@ class TeaserPresenter {
}

get displayStandfirst () {
return this.data.promotionalStandfirst || this.data.standfirst;
//Note: although everywhere else we prefer the promotional version for teasers, we can't do that for standfirsts because the promotionalStandfirst is used for the App Skyline.
//So we will only use the promotionalStandfirst if there is no standfirst
return this.data.standfirst || this.data.promotionalStandfirst;
}

get displayImage () {
Expand Down
11 changes: 8 additions & 3 deletions tests/presenters/teaser-presenter.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -750,18 +750,23 @@ describe('Teaser Presenter', () => {
describe('display standfirst', () => {
const standfirst = { standfirst: 'This is the standfirst' };
const promotionalStandfirst = { promotionalStandfirst: 'This is promotional' };

it('uses the standfirst if no promotional', () => {
const content = Object.assign({}, standfirst);
subject = new Presenter(content);
expect(subject.displayStandfirst).to.equal('This is the standfirst');
});

it('prefers the promotional standfirst if available', () => {
const content = Object.assign({}, standfirst, promotionalStandfirst);
it('uses the promotional if no standfirst', () => {
const content = Object.assign({}, promotionalStandfirst);
subject = new Presenter(content);
expect(subject.displayStandfirst).to.equal('This is promotional');
});

it('prefers the regular standfirst (because promotionalStandfirst is used for web app skylines)', () => {
const content = Object.assign({}, standfirst, promotionalStandfirst);
subject = new Presenter(content);
expect(subject.displayStandfirst).to.equal('This is the standfirst');
});
});

describe('display image', () => {
Expand Down

0 comments on commit b83fdb4

Please sign in to comment.