BVB Source Codes

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

Return Download in-view: download in-view.spec.js Source code - Download in-view Source code - Type:.js
  1. import test from 'ava';
  2. import inView from '../src/in-view';
  3. import Registry from '../src/registry';
  4.  
  5. test('inView is a function', t => {
  6.     t.true(typeof inView === 'function');
  7. });
  8.  
  9. test('inView returns a registry', t => {
  10.     t.true(inView('body').__proto__ === Registry([]).__proto__);
  11. });
  12.  
  13. test('inView returns existing registries', t => {
  14.     let registry = inView('body');
  15.     t.true(registry === inView('body'));
  16. });
  17.  
  18. test('inView updates existing registry elements', t => {
  19.  
  20.     const addDiv = () => {
  21.         document.body.appendChild(
  22.             document.createElement('div')
  23.         );
  24.     };
  25.  
  26.     t.true(inView('div').elements.length === 0);
  27.  
  28.     addDiv();
  29.     t.true(inView('div').elements.length === 1);
  30.  
  31. });
  32.  
  33. test.after(initBrowserEnv);
  34.  
downloadin-view.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
pydata-book - Materials and IPython notebooks for "Python for Da... 2017-02-19
xenia - Xbox 360 Emulator Research Project ... 2017-02-18
flux-comparison - 2017-02-18
luvit - Lua + libUV + jIT = pure awesomesauce ... 2017-02-18
orleans - Orleans - Distributed Virtual Actor Model ... 2017-02-18
gemoji - Emoji images and names. 2017-02-18
gruvbox - Retro groove color scheme for Vim 2017-02-18
office-ui-fabric-core - The front-end framework for building experiences f... 2017-02-18
ZipArchive - ZipArchive is a simple utility class for zipping a... 2017-02-18
spray - A suite of scala libraries for building and consum... 2017-02-18

 Back to top