Skip to content

Commit

Permalink
Add deleted and invalid tweet-id cases
Browse files Browse the repository at this point in the history
  • Loading branch information
caroqliu committed May 7, 2021
1 parent 648bd73 commit 95c5c00
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 0 deletions.
48 changes: 48 additions & 0 deletions extensions/amp-twitter/0.1/storybook/Basic.amp.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,51 @@ export const timelines = () => {
/>
);
};

export const deletedTweet = () => {
const withFallback = boolean('include fallback?', true);
return (
<amp-twitter
width="390"
height="330"
layout="fixed"
data-tweetid="882818033403789316"
data-cards="hidden"
>
<blockquote placeholder class="twitter-tweet" data-lang="en">
<p lang="en" dir="ltr">
AMP test
</p>
&mdash; Gharbi Wassim (@wassgha){' '}
<a href="https://twitter.com/wassgha/status/882818033403789316">
July 6, 2017
</a>
</blockquote>
{withFallback && (
<div fallback>
An error occurred while retrieving the tweet. It might have been
deleted.
</div>
)}
</amp-twitter>
);
};

export const invalidTweet = () => {
return (
<amp-twitter
width="390"
height="330"
layout="fixed"
data-tweetid="1111111111111641653602164060160"
data-cards="hidden"
>
<blockquote placeholder class="twitter-tweet" data-lang="en">
<p>
This placeholder should never change because given tweet-id is
invalid.
</p>
</blockquote>
</amp-twitter>
);
};
48 changes: 48 additions & 0 deletions extensions/amp-twitter/1.0/storybook/Basic.amp.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,51 @@ export const timelines = () => {
/>
);
};

export const deletedTweet = () => {
const withFallback = boolean('include fallback?', true);
return (
<amp-twitter
width="390"
height="330"
layout="fixed"
data-tweetid="882818033403789316"
data-cards="hidden"
>
<blockquote placeholder class="twitter-tweet" data-lang="en">
<p lang="en" dir="ltr">
AMP test
</p>
&mdash; Gharbi Wassim (@wassgha){' '}
<a href="https://twitter.com/wassgha/status/882818033403789316">
July 6, 2017
</a>
</blockquote>
{withFallback && (
<div fallback>
An error occurred while retrieving the tweet. It might have been
deleted.
</div>
)}
</amp-twitter>
);
};

export const invalidTweet = () => {
return (
<amp-twitter
width="390"
height="330"
layout="fixed"
data-tweetid="1111111111111641653602164060160"
data-cards="hidden"
>
<blockquote placeholder class="twitter-tweet" data-lang="en">
<p>
This placeholder should never change because given tweet-id is
invalid.
</p>
</blockquote>
</amp-twitter>
);
};

0 comments on commit 95c5c00

Please sign in to comment.