BVB Source Codes

parse-server Show MongoSchemaCollectionAdapter.spec.js Source code

Return Download parse-server: download MongoSchemaCollectionAdapter.spec.js Source code - Download parse-server Source code - Type:.js
  1. 'use strict';
  2.  
  3. const MongoSchemaCollection = require('../src/Adapters/Storage/Mongo/MongoSchemaCollection').default;
  4.  
  5. describe('MongoSchemaCollection', () => {
  6.   it('can transform legacy _client_permissions keys to parse format', done => {
  7.     expect(MongoSchemaCollection._TESTmongoSchemaToParseSchema({
  8.       "_id":"_Installation",
  9.       "_client_permissions":{
  10.         "get":true,
  11.         "find":true,
  12.         "update":true,
  13.         "create":true,
  14.         "delete":true,
  15.       },
  16.       "_metadata":{
  17.         "class_permissions":{
  18.           "get":{"*":true},
  19.           "find":{"*":true},
  20.           "update":{"*":true},
  21.           "create":{"*":true},
  22.           "delete":{"*":true},
  23.           "addField":{"*":true},
  24.         }
  25.       },
  26.       "installationId":"string",
  27.       "deviceToken":"string",
  28.       "deviceType":"string",
  29.       "channels":"array",
  30.       "user":"*_User",
  31.       "pushType":"string",
  32.       "GCMSenderId":"string",
  33.       "timeZone":"string",
  34.       "localeIdentifier":"string",
  35.       "badge":"number",
  36.       "appVersion":"string",
  37.       "appName":"string",
  38.       "appIdentifier":"string",
  39.       "parseVersion":"string",
  40.     })).toEqual({
  41.       className: '_Installation',
  42.       fields: {
  43.         installationId: { type: 'String' },
  44.         deviceToken: { type: 'String' },
  45.         deviceType: { type: 'String' },
  46.         channels: { type: 'Array' },
  47.         user: { type: 'Pointer', targetClass: '_User' },
  48.         pushType: { type: 'String' },
  49.         GCMSenderId: { type: 'String' },
  50.         timeZone: { type: 'String' },
  51.         localeIdentifier: { type: 'String' },
  52.         badge: { type: 'Number' },
  53.         appVersion: { type: 'String' },
  54.         appName: { type: 'String' },
  55.         appIdentifier: { type: 'String' },
  56.         parseVersion: { type: 'String' },
  57.         ACL: { type: 'ACL' },
  58.         createdAt: { type: 'Date' },
  59.         updatedAt: { type: 'Date' },
  60.         objectId: { type: 'String' },
  61.       },
  62.       classLevelPermissions: {
  63.         find: { '*': true },
  64.         get: { '*': true },
  65.         create: { '*': true },
  66.         update: { '*': true },
  67.         delete: { '*': true },
  68.         addField: { '*': true },
  69.       }
  70.     });
  71.     done();
  72.   });
  73. });
  74.  
downloadMongoSchemaCollectionAdapter.spec.js Source code - Download parse-server Source code
Related Source Codes/Software:
react-boilerplate - 2017-06-07
webtorrent - Streaming torrent client for the web ... 2017-06-06
machine-learning-for-software-engineers - A complete daily plan for studying to become a mac... 2017-06-06
upterm - A terminal emulator for the 21st century. 2017-06-06
lottie-android - Render After Effects animations natively on Androi... 2017-06-07
AsyncDisplayKit - Smooth asynchronous user interfaces for iOS apps. ... 2017-06-07
ionicons - The premium icon font for Ionic ... 2017-06-07
storybook - 2017-06-07
prettier - Prettier is an opinionated JavaScript formatter. ... 2017-06-08
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