All files manifest.spec.js

100% Statements 18/18
100% Branches 0/0
100% Functions 2/2
100% Lines 18/18
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 341x   1x   1x 1x       1x 1x 1x   1x 1x 1x 1x 1x     1x 1x         1x 1x   1x   1x    
import { test } from 'blue-tape';
 
import createManifest from './manifest';
 
test('unit :: manifest :: default', (assert) => {
  const items = [{
    name: 'item-name',
    zip: '/item/path/package.zip',
  }];
  const name = 'my-collection';
  const manifest = createManifest(items, name);
  const provisioningItem = manifest.provisioningItems[0];
 
  assert.equal(manifest.name, name, 'uses the provided name for the manifest');
  assert.equal(provisioningItem.itemType, 'catalog', 'uses default itemType of "catalog"');
  assert.equal(provisioningItem.name, 'item-name', 'uses item name for provisioning item name');
  assert.equal(provisioningItem.location, 'package.zip', 'extracts the filename of the package');
  assert.end();
});
 
test('unit :: manifiest :: content-repository', (assert) => {
  const items = [{
    name: 'foo',
    zip: '/some/zip.zip',
    type: 'contentRepository',
  }];
  const manifest = createManifest(items, 'my-collection');
  const provisioningItem = manifest.provisioningItems[0];
 
  assert.equal(provisioningItem.itemType, 'contentRepository',
    'uses itemType of "contentRepository" for content repository items');
  assert.end();
});