BVB Source Codes

in-view Show in-view.offset.spec.js Source code

Return Download in-view: download in-view.offset.spec.js Source code - Download in-view Source code - Type:.js
  1. import test from 'ava';
  2. import inView from '../src/in-view';
  3.  
  4. test('inView.offset returns the offset', t => {
  5.     const stub = {
  6.         top: 0,
  7.         right: 0,
  8.         bottom: 0,
  9.         left: 0
  10.     };
  11.     t.deepEqual(inView.offset(0), stub);
  12.     t.deepEqual(inView.offset(), stub);
  13. });
  14.  
  15. test('inView.offset accepts a number', t => {
  16.     t.deepEqual(inView.offset(10), {
  17.         top: 10,
  18.         right: 10,
  19.         bottom: 10,
  20.         left: 10
  21.     });
  22. });
  23.  
  24. test('inView.offset accepts an object', t => {
  25.     t.deepEqual(inView.offset({
  26.         top: 25,
  27.         right: 50,
  28.         bottom: 75,
  29.         left: 100
  30.     }), {
  31.         top: 25,
  32.         right: 50,
  33.         bottom: 75,
  34.         left: 100
  35.     });
  36. });
  37.  
downloadin-view.offset.spec.js Source code - Download in-view Source code
Related Source Codes/Software:
magictools - 2017-01-09
elm-compiler - Compiler for Elm, a functional language for reliab... 2017-01-09
Twig - Twig, the flexible, fast, and secure template lang... 2017-01-09
android-testing - A collection of samples demonstrating different fr... 2017-01-09
lib-flexible - Scalable layout scheme 2017-01-09
sinon - Test spies, stubs and mocks for JavaScript. ... 2017-01-09
docker-gitlab - Dockerized GitLab http://www.da... 2017-01-09
Side-Menu.Android - Side menu with some categories to choose. ... 2017-01-09
libsodium - A modern and easy-to-use crypto library. 2017-01-09
prerender - Node server that uses phantomjs to render a javasc... 2017-01-09
mongo-express - Web-based MongoDB admin interface, written with No... 2017-05-17
XCL-Charts - Android charting libraries (XCL-Charts is a free c... 2017-05-17
scrollMonitor - A simple and fast API to monitor elements as you s... 2017-05-16
XCDYouTubeKit - YouTube video player for iOS, tvOS and macOS 2017-05-16
rails-erd - Generate Entity-Relationship Diagrams for Rails ap... 2017-05-16
np - A better `npm publish` 2017-05-16
android - Smartisan open source code for full build.(repo ma... 2017-05-16
word_cloud - A little word cloud generator in Pytho 2017-05-16
mobileplayer-ios - 2017-05-16
Destroy-Windows-10-Spying - Destroy Windows Spying tool ... 2017-05-15

 Back to top