All files / util activityDefine.js

100% Statements 16/16
100% Branches 0/0
100% Functions 4/4
100% Lines 16/16

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 4815x     45x 45x   45x 45x 45x 45x 45x   45x 45x     45x 15x     45x 30x                 45x                             45x    
module.exports = function() {
  'use strict'
 
  const MODEL_PAGE = 'Page'
  const MODEL_COMMENT = 'Comment'
 
  const ACTION_CREATE = 'CREATE' // Not support yet
  const ACTION_MODIFY = 'MODIFY' // Not support yet
  const ACTION_DELETE = 'DELETE' // Not support yet
  const ACTION_COMMENT = 'COMMENT'
  const ACTION_LIKE = 'LIKE'
 
  const getSupportTargetModelNames = function() {
    return [MODEL_PAGE]
  }
 
  const getSupportEventModelNames = function() {
    return [MODEL_COMMENT]
  }
 
  const getSupportActionNames = function() {
    return [
      // ACTION_CREATE,
      // ACTION_MODIFY,
      // ACTION_DELETE,
      ACTION_COMMENT,
      ACTION_LIKE,
    ]
  }
 
  const activityDefine = {
    MODEL_PAGE,
    MODEL_COMMENT,
 
    ACTION_CREATE, // Not support yet
    ACTION_MODIFY, // Not support yet
    ACTION_DELETE, // Not support yet
    ACTION_COMMENT,
    ACTION_LIKE,
 
    getSupportTargetModelNames,
    getSupportEventModelNames,
    getSupportActionNames,
  }
 
  return activityDefine
}