Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
metal-messiah committed Jan 16, 2025
1 parent 1ee45a5 commit 961c850
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/features/generic_events/aggregate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ export class Aggregate extends AggregateBase {

function createDetailAttrs (obj, rootKey = '', output = {}) {
if (obj === null || obj === undefined) return output
// if (typeof obj === 'string') output.entryDetail = obj
else if (typeof obj !== 'object') output.entryDetail = obj
else {
Object.entries(obj).forEach(([key, value]) => {
Expand Down
16 changes: 8 additions & 8 deletions tests/specs/ins/harvesting.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,21 +245,21 @@ describe('ins harvesting', () => {

expect(insHarvest.length).toEqual(8) // this page sets seven measures
// detail: {foo:'bar'}
expect(insHarvest[0]['entryDetail.foo']).toEqual('bar')
expect(insHarvest.find(x => x.entryName === 'simple-object')['entryDetail.foo']).toEqual('bar')
// detail: {nested1:{nested2:{nested3:{nested4: {foo: 'bar'}}}}
expect(insHarvest[1]['entryDetail.nested1.nested2.nested3.nested4.foo']).toEqual('bar')
expect(insHarvest.find(x => x.entryName === 'nested-object')['entryDetail.nested1.nested2.nested3.nested4.foo']).toEqual('bar')
// detail: 'hi'
expect(insHarvest[2].entryDetail).toEqual('hi')
expect(insHarvest.find(x => x.entryName === 'string').entryDetail).toEqual('hi')
// detail: ''
expect(insHarvest[3].entryDetail).toEqual('')
expect(insHarvest.find(x => x.entryName === 'falsy-string').entryDetail).toEqual('')
// detail: 1
expect(insHarvest[4].entryDetail).toEqual(1)
expect(insHarvest.find(x => x.entryName === 'number').entryDetail).toEqual(1)
// detail: 0
expect(insHarvest[5].entryDetail).toEqual(0)
expect(insHarvest.find(x => x.entryName === 'falsy-number').entryDetail).toEqual(0)
// detail: true
expect(insHarvest[6].entryDetail).toEqual(true)
expect(insHarvest.find(x => x.entryName === 'boolean').entryDetail).toEqual(true)
// detail: false
expect(insHarvest[7].entryDetail).toEqual(false)
expect(insHarvest.find(x => x.entryName === 'falsy-boolean').entryDetail).toEqual(false)
})

;[
Expand Down

0 comments on commit 961c850

Please sign in to comment.