-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58 from rambler-digital-solutions/resize-slot
fix: 🐜 resize slot on adUnit resize
- Loading branch information
Showing
10 changed files
with
116 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/adContainer/helpers/__tests__/__snapshots__/createSlot.spec.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`createSlot must return a slot element 1`] = ` | ||
<div | ||
style="border: 0px; cursor: pointer; height: 200px; left: 0px; margin: 0px; padding: 0px; position: absolute; top: 0px; width: 300px;" | ||
/> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import createSlot from '../createSlot'; | ||
|
||
describe('createSlot', () => { | ||
test('must return a slot element', () => { | ||
const slot = createSlot(document.body, 300, 200); | ||
|
||
expect(slot).toBeInstanceOf(HTMLDivElement); | ||
expect(slot).toMatchSnapshot(); | ||
|
||
slot.parentElement.removeChild(slot); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const createSlot = (placeholder, width, height) => { | ||
const slot = document.createElement('DIV'); | ||
|
||
Object.assign(slot.style, { | ||
border: '0px', | ||
cursor: 'pointer', | ||
height: `${height}px`, | ||
left: '0px', | ||
margin: '0px', | ||
padding: '0px', | ||
position: 'absolute', | ||
top: '0px', | ||
width: `${width}px` | ||
}); | ||
|
||
placeholder.appendChild(slot); | ||
|
||
return slot; | ||
}; | ||
|
||
export default createSlot; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters