Skip to content

Commit

Permalink
feat: 🎸 getDetails method to get the details of
Browse files Browse the repository at this point in the history
... a VastChain
  • Loading branch information
carpasse committed Dec 13, 2018
1 parent 27fe4ed commit cc796d3
Show file tree
Hide file tree
Showing 6 changed files with 688 additions and 4 deletions.
8 changes: 6 additions & 2 deletions fixtures/vast-inline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<VAST version="4.0">
<Ad id="abc123">
<InLine>
<Pricing model="cpm" currency="EUR">
<![CDATA[ 25.00 ]]>
</Pricing>
<AdServingId>ADID_INSIMPLETEST_ABC123</AdServingId>
<AdSystem version="1.0">MOL</AdSystem>
<AdTitle>VAST 4.0 Test</AdTitle>
<Error>https://test.example.com/error</Error>
Expand All @@ -19,8 +23,8 @@
</ViewableImpression>
<AdVerification/>
<Creatives>
<Creative adId="abc123" apiFramework="mol-api">
<UniversalAdId idValue="unknown">unknown</UniversalAdId>
<Creative adId="inline123" id="inline123" apiFramework="mol-api">
<UniversalAdId idRegistry="Ad-ID">8465</UniversalAdId>
<CreativeExtensions>
<CreativeExtension>
<Custom>this is custom stuff</Custom>
Expand Down
5 changes: 4 additions & 1 deletion fixtures/vast-wrapper.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
<VASTAdTagURI><![CDATA[https://test.example.com/vastadtaguri]]></VASTAdTagURI>
<Error><![CDATA[https://test.example.com/error/[ERRORCODE]]]></Error>
<Impression><![CDATA[https://test.example.com/impression]]></Impression>
<Pricing model="cpm" currency="USD">
<![CDATA[ 25.00 ]]>
</Pricing>
<Creatives>
<Creative sequence="1">
<Creative sequence="1" id="wrapper123" adId="wrapper123">
<Linear>
<TrackingEvents>
<Tracking event="start"><![CDATA[https://test.example.com/start]]></Tracking>
Expand Down
107 changes: 107 additions & 0 deletions src/vastChain/__tests__/__snapshots__/getDetails.spec.js.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`getDetails must return the media files 1`] = `
Array [
Object {
"apiFramework": undefined,
"bitrate": "600",
"codec": undefined,
"delivery": "progressive",
"height": "1080",
"id": undefined,
"maintainAspectRatio": "true",
"maxBitrate": undefined,
"minBitrate": undefined,
"scalable": "true",
"src": "https://test.example.com/test1920x1080.mp4",
"type": "video/mp4",
"universalAdId": "8465",
"width": "1920",
},
Object {
"apiFramework": undefined,
"bitrate": "600",
"codec": undefined,
"delivery": "progressive",
"height": "432",
"id": undefined,
"maintainAspectRatio": "true",
"maxBitrate": undefined,
"minBitrate": undefined,
"scalable": "true",
"src": "https://test.example.com/test768x432.mp4",
"type": "video/mp4",
"universalAdId": "8465",
"width": "768",
},
Object {
"apiFramework": undefined,
"bitrate": "600",
"codec": undefined,
"delivery": "progressive",
"height": "362",
"id": undefined,
"maintainAspectRatio": "true",
"maxBitrate": undefined,
"minBitrate": undefined,
"scalable": "true",
"src": "https://test.example.com/test640x362.mp4",
"type": "video/mp4",
"universalAdId": "8465",
"width": "640",
},
]
`;

exports[`getDetails must return the media files 2`] = `
Array [
Object {
"apiFramework": undefined,
"bitrate": "600",
"codec": undefined,
"delivery": "progressive",
"height": "1080",
"id": undefined,
"maintainAspectRatio": "true",
"maxBitrate": undefined,
"minBitrate": undefined,
"scalable": "true",
"src": "https://test.example.com/test1920x1080.mp4",
"type": "video/mp4",
"universalAdId": "8465",
"width": "1920",
},
Object {
"apiFramework": undefined,
"bitrate": "600",
"codec": undefined,
"delivery": "progressive",
"height": "432",
"id": undefined,
"maintainAspectRatio": "true",
"maxBitrate": undefined,
"minBitrate": undefined,
"scalable": "true",
"src": "https://test.example.com/test768x432.mp4",
"type": "video/mp4",
"universalAdId": "8465",
"width": "768",
},
Object {
"apiFramework": undefined,
"bitrate": "600",
"codec": undefined,
"delivery": "progressive",
"height": "362",
"id": undefined,
"maintainAspectRatio": "true",
"maxBitrate": undefined,
"minBitrate": undefined,
"scalable": "true",
"src": "https://test.example.com/test640x362.mp4",
"type": "video/mp4",
"universalAdId": "8465",
"width": "640",
},
]
`;
Loading

0 comments on commit cc796d3

Please sign in to comment.