IterablePathTests.js 554 B

123456789101112131415161718
  1. const { expect } = require('chai')
  2. const {
  3. iterablePaths,
  4. } = require('../../../../app/src/Features/Project/IterablePath')
  5. describe('iterablePaths', function () {
  6. it('returns an empty array for empty folders', function () {
  7. expect(iterablePaths(null, 'docs')).to.deep.equal([])
  8. expect(iterablePaths({}, 'docs')).to.deep.equal([])
  9. })
  10. it('returns the `docs` object when it is iterable', function () {
  11. const folder = {
  12. docs: [{ _id: 1 }, { _id: 2 }],
  13. }
  14. expect(iterablePaths(folder, 'docs')).to.equal(folder.docs)
  15. })
  16. })