Skip to content

Commit

Permalink
fix gift-article fetch mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
apaleslimghost committed Oct 31, 2018
1 parent 8cd71f4 commit c9ce8bd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions components/x-gift-article/stories/native-share.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const articleId = 'article id';
const articleUrl = 'https://www.ft.com/content/blahblahblah';
const articleUrlRedeemed = 'https://gift-url-redeemed';
const nonGiftArticleUrl = `${articleUrl}?shareType=nongift`;
Expand All @@ -9,7 +10,7 @@ exports.data = {
isFreeArticle: false,
articleUrl,
articleTitle: 'Title Title Title Title',
articleId: 'article id',
articleId,
sessionId: 'session id',
nativeShare: true,
id: 'base-gift-article-static-id'
Expand Down Expand Up @@ -40,8 +41,8 @@ exports.fetchMock = fetchMock => {
`/article/shorten-url/${ encodeURIComponent(nonGiftArticleUrl) }`,
{ shortenedUrl: 'https://shortened-non-gift-url' }
)
.post(
'/article-email/gift-link',
.get(
`/article/gift-link/${ encodeURIComponent(articleId) }`,
{
'redemptionUrl': articleUrlRedeemed,
'remainingAllowance': 1
Expand Down
7 changes: 4 additions & 3 deletions components/x-gift-article/stories/with-gift-credits.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const articleId = 'article id';
const articleUrl = 'https://www.ft.com/content/blahblahblah';
const articleUrlRedeemed = 'https://gift-url-redeemed';
const nonGiftArticleUrl = `${articleUrl}?shareType=nongift`;
Expand All @@ -9,7 +10,7 @@ exports.data = {
isFreeArticle: false,
articleUrl,
articleTitle: 'Title Title Title Title',
articleId: 'article id',
articleId,
sessionId: 'session id',
showMobileShareLinks: true,
id: 'base-gift-article-static-id'
Expand Down Expand Up @@ -40,8 +41,8 @@ exports.fetchMock = fetchMock => {
`/article/shorten-url/${ encodeURIComponent(nonGiftArticleUrl) }`,
{ shortenedUrl: 'https://shortened-non-gift-url' }
)
.post(
'/article-email/gift-link',
.get(
`/article/gift-link/${ encodeURIComponent(articleId) }`,
{
'redemptionUrl': articleUrlRedeemed,
'remainingAllowance': 1
Expand Down

0 comments on commit c9ce8bd

Please sign in to comment.