<commit_before>'use strict'

const sampleIdentity = require('../mocks/identity.sample')
const ParamFilter = require('../../src/param-filter')

describe('Param-filter Class', () => {
  describe('.filterInput', () => {
    it('Should work when runing with a valid action with a valid indentity', (done) => {
      let sampleAction = require('../mocks/action.sample')
      return ParamFilter.filterInput(sampleIdentity, sampleIdentity, sampleAction)
        .then((data) => {
          data.event.body.should.have.property('name')
          data.event.headers.should.have.property('apiKey')
          data.event.queryParams.should.not.have.property('id')
          return done()
        })
    })
    it('Should work when runing without params', (done) => {
      let sampleAction = require('../mocks/action.sample')
      delete sampleAction.event.body.name
      delete sampleAction.event.headers.secretKey
      delete sampleAction.event.queryParams.account_id
      return ParamFilter.filterInput(sampleIdentity, sampleIdentity, sampleAction)
        .then((data) => {
          return done()
        })
    })
  })
})<commit_msg>changing sampleaction at tests<commit_after>'use strict'

const sampleIdentity = require('../mocks/identity.sample')
const ParamFilter = require('../../src/param-filter')

describe('Param-filter Class', () => {
  describe('.filterInput', () => {
    it('Should work when runing with a valid action with a valid indentity', (done) => {
      let sampleAction = require('../mocks/action.sample')
      return ParamFilter.filterInput(sampleIdentity, sampleIdentity, sampleAction)
        .then((data) => {
          data.event.body.should.have.property('name')
          data.event.headers.should.have.property('apiKey')
          data.event.queryParams.should.not.have.property('id')
          return done()
        })
    })
    it('Should work when runing without params', (done) => {
      let sampleAction = Object.assign({}, require('../mocks/action.sample'),
        {
          event: {
            body: {},
            headers: { apiKey: 'aHashedSecretKey' },
            pathParams: {},
            queryParams: {},
            method: 'PUT',
            resourcePath: '/User',
            source: 'aws.apiGateway'
          }
        })
      return ParamFilter.filterInput(sampleIdentity, sampleAction)
        .then((data) => {
          return done()
        })
    })
  })
  describe('.filterOutput', () => {
    it('Should work when runing with valid identity, model and action', (done) => {
      let sampleAction = require('../mocks/action.sample')
      console.log(require('../mocks/action.sample'))
      return done()
    })
  })
})
{'fraction_non_alphanumeric': 0.15201192250372578, 'fraction_numerical': 0.0, 'mean_word_length': 2.58, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '947141', 'n_tokens_mistral': 731, 'n_tokens_neox': 735, 'n_words': 148}