IterablePath.test.mjs 547 B

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