BVB Source Codes

react-sketchapp Show shapeLayers.js Source code

Return Download react-sketchapp: download shapeLayers.js Source code - Download react-sketchapp Source code - Type:.js
  1. import {
  2.   makeRectPath,
  3.   makeShapePath,
  4.   makeRectShapeLayer,
  5.   makeShapeGroup,
  6. } from '../../src/jsonUtils/shapeLayers';
  7.  
  8. xdescribe('makeHorizontalPath');
  9. xdescribe('makeVerticalPath');
  10. describe('makeRectPath', () => {
  11.   it('is correctly constructed', () => {
  12.     const path = makeRectPath([10, 20, 30, 40]);
  13.  
  14.     expect(path.points[0]).toHaveProperty('cornerRadius', 10);
  15.     expect(path.points[1]).toHaveProperty('cornerRadius', 20);
  16.     expect(path.points[2]).toHaveProperty('cornerRadius', 30);
  17.     expect(path.points[3]).toHaveProperty('cornerRadius', 40);
  18.   });
  19. });
  20.  
  21. describe('makeShapePath', () => {
  22.   it('is correctly constructed', () => {
  23.     const frame = { foo: 'bar' };
  24.     const path = { baz: 'qux' };
  25.     const shapePath = makeShapePath(frame, path);
  26.  
  27.     expect(shapePath).toHaveProperty('frame', frame);
  28.     expect(shapePath).toHaveProperty('path', path);
  29.   });
  30. });
  31.  
  32. describe('makeRectShapeLayer', () => {
  33.   it('is correctly constructed', () => {
  34.     const shapeLayer = makeRectShapeLayer(100, 200, 300, 400, [10, 20, 30, 40]);
  35.  
  36.     expect(shapeLayer).toHaveProperty('frame.x', 100);
  37.     expect(shapeLayer).toHaveProperty('frame.y', 200);
  38.     expect(shapeLayer).toHaveProperty('frame.width', 300);
  39.     expect(shapeLayer).toHaveProperty('frame.height', 400);
  40.     expect(shapeLayer).toHaveProperty('fixedRadius', 10);
  41.   });
  42. });
  43.  
  44. describe('makeShapeGroup', () => {
  45.   it('is correctly constructed', () => {
  46.     const frame = { foo: 'bar' };
  47.     const layers = [{ baz: 'qux' }];
  48.     const fills = ['foo', 'bar'];
  49.  
  50.     const shapeGroup = makeShapeGroup(frame, layers, fills);
  51.  
  52.     expect(shapeGroup).toHaveProperty('frame', frame);
  53.     expect(shapeGroup).toHaveProperty('layers', layers);
  54.     expect(shapeGroup).toHaveProperty('style.fills', fills);
  55.   });
  56. });
  57.  
downloadshapeLayers.js Source code - Download react-sketchapp Source code
Related Source Codes/Software:
yoga - Yoga is a cross-platform layout engine which imple... 2017-06-05
bash-guide - A guide to learn bash 2017-06-05
N-blog - Learn the Node together. J 2017-06-05
Become-A-Full-Stack-Web-Developer - Free resources for learning Full Stack Web Develop... 2017-06-05
compromise - Natural language processing in javascript ... 2017-06-05
jquery-validation - jQuery Validation Plugin library sources ... 2017-06-05
mithril.js - A Javascript Framework for Building Brilliant Appl... 2017-06-05
localstack - A fully functional local AWS cloud stack. Develop ... 2017-06-05
vue2-elm - Based on vue2 + vuex to build a large single-page ... 2017-06-05
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top