Skip to content

Commit

Permalink
test: update test for og:image:support
Browse files Browse the repository at this point in the history
  • Loading branch information
totto2727 committed Mar 2, 2024
1 parent 4fdf747 commit 7f9e115
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/integration/basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ describe('basic', function () {
width: '300',
height: '300',
type: 'image/png',
alt: 'The Open Graph logo',
}]);
expect(result.requestUrl).to.be.eql('https://ogp.me/');
expect(result.charset).to.be.eql('utf-8');
Expand Down Expand Up @@ -61,6 +62,7 @@ describe('basic', function () {
width: '300',
height: '300',
type: 'image/png',
alt: 'The Open Graph logo',
}]);
expect(result.requestUrl).to.be.eql('https://ogp.me/');
expect(result.charset).to.be.eql('utf-8');
Expand Down Expand Up @@ -94,6 +96,7 @@ describe('basic', function () {
width: '300',
height: '300',
type: 'image/png',
alt: 'The Open Graph logo',
}]);
expect(response.result.requestUrl).to.be.eql('https://ogp.me/');
expect(response.result.charset).to.be.eql('utf-8');
Expand All @@ -112,6 +115,7 @@ describe('basic', function () {
expect(result.ogUrl).to.be.eql('https://ogp.me/');
expect(result.ogDescription).to.be.eql('The Open Graph protocol enables any web page to become a rich object in a social graph.');
expect(result.ogImage).to.be.eql([{
alt: 'The Open Graph logo',
url: 'https://ogp.me/logo.png',
width: '300',
height: '300',
Expand Down
2 changes: 2 additions & 0 deletions tests/integration/static.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1760,6 +1760,7 @@ describe('static', function () {
width: '1200',
height: '630',
type: 'image/jpeg',
alt: 'FILE - In this Oct. 8, 2014, file photo, a Wall Street address is carved in the side of a building in New York. Stocks are opening modestly higher on Wall Street, Friday, Aug. 11, 2017, led by gains in technology companies and banks. (AP Photo/Mark Lennihan, File)',
}]);
expect(result.twitterImage).to.be.eql([{
url: 'https://ca-times.brightspotcdn.com/dims4/default/3d21428/2147483647/strip/true/crop/2048x1152+0+51/resize/1200x675!/quality/90/?url=https%3A%2F%2Fcalifornia-times-brightspot.s3.amazonaws.com%2Ff2%2F6c%2F8f7e89b7eb2a7ecc01f245e3ec0b%2Fla-1502459693-4svslqel7u-snap-image',
Expand Down Expand Up @@ -2800,6 +2801,7 @@ describe('static', function () {
expect(result.ogLocale).to.be.eql('en');
expect(result.twitterUrl).to.be.eql('https://www.vox.com/recode/2020/6/11/21287395/jack-dorsey-start-small-billionaire-philanthropy-coronavirus-twitter-square-kaepernick-rihanna');
expect(result.ogImage).to.be.eql([{
alt: 'Jack Dorsey Sydney Photo Shoot',
url: 'https://cdn.vox-cdn.com/thumbor/PP5h21sGbjyDt0BoZYKpdNUsFFs=/0x0:4746x2485/fit-in/1200x630/cdn.vox-cdn.com/uploads/chorus_asset/file/20030444/524250960.jpg.jpg',
width: '1200',
height: '630',
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/static.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ describe('static check meta tags', function () {
<meta property="og:image:type" content="image/png">
<meta property="og:image:width" content="1">
<meta property="og:image" content="http://foobar.png">
<meta property="og:image:alt" content="alt text">
<meta property="og:image:secure_url" content="https://foobar.png">
</head></html>`;

Expand All @@ -128,6 +129,7 @@ describe('static check meta tags', function () {
width: '1',
height: '2',
type: 'image/png',
alt: 'alt text',
}]);
expect(data.html).to.be.eql(metaHTML);
expect(data.response).to.be.a('response');
Expand Down

0 comments on commit 7f9e115

Please sign in to comment.