Skip to content

Commit

Permalink
fix: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
raiindev committed Oct 16, 2024
1 parent a5d4f1e commit cdfdecb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
1 change: 0 additions & 1 deletion server/services/orama-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
const { CloudManager } = require('@oramacloud/client')
const {
getSchemaFromEntryStructure,
filterSearchableAttributesEntry,
getSchemaFromAttributes
} = require('../../utils/schema')

Expand Down
23 changes: 1 addition & 22 deletions utils/schema.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const {
getSchemaFromAttributes,
getSelectedAttributesFromSchema,
getSchemaFromEntryStructure,
filterSearchableAttributesEntry
getSchemaFromEntryStructure
} = require('./schema')

describe('Schema Utils', () => {
Expand Down Expand Up @@ -84,24 +83,4 @@ describe('Schema Utils', () => {
})
})
})

describe('filterSearchableAttributesEntry', () => {
it('should return only the searchable attributes', () => {
const entry = {
potato: 'hello',
apple: 5,
watermelon: {
seeds: {
many: true
}
},
banana: ['yellow', 'green']
}
const searchable = ['potato', 'banana']

const result = filterSearchableAttributesEntry(searchable, entry)

expect(result).toEqual({ potato: 'hello', banana: ['yellow', 'green'] })
})
})
})

0 comments on commit cdfdecb

Please sign in to comment.