// DecentCMS (c) 2014 Bertrand Le Roy, under MIT. See LICENSE.txt for licensing details.
'use strict';

@@ -96,8 +96,1542 @@
 trict';%0A
+var expect = require('chai').expect;%0A%0Avar TextPart = require('../services/text-part');%0A%0Adescribe('Text Part Handler', function() %7B%0A  it('adds shapes for each text part', function() %7B%0A    var item = %7B%0A      title: 'Foo',%0A      body: %7B%0A        src: 'body.md',%0A        _data: 'Lorem ipsum'%0A      %7D,%0A      summary: 'Lorem',%0A      disclaimer: %7B%0A        flavor: 'strawberry',%0A        text: 'Not my fault'%0A      %7D,%0A      tags: %5B'foo', 'bar'%5D%0A    %7D;%0A    var options = %7B%0A      shape: %7B%0A        meta: %7B%0A          type: 'content'%0A        %7D,%0A        temp: %7B%0A          item: item,%0A          displayType: 'summary',%0A          shapes: %5B%5D%0A        %7D%0A      %7D,%0A      renderStream: %7B%0A        contentManager: %7B%0A          getParts: function() %7B%0A            return %5B'body', 'summary', 'other', 'disclaimer'%5D;%0A          %7D%0A        %7D%0A      %7D%0A    %7D;%0A%0A    TextPart.on%5B'decent.core.handle-item'%5D(%7B%7D, options);%0A%0A    var newShapes = options.shape.temp.shapes;%0A    expect(newShapes%5B0%5D)%0A      .to.deep.equal(%7B%0A        meta: %7Btype: 'text', name: 'body'%7D,%0A        temp: %7BdisplayType: 'summary'%7D,%0A        text: 'Lorem ipsum',%0A        flavor: 'md'%0A      %7D);%0A    expect(newShapes%5B1%5D)%0A      .to.deep.equal(%7B%0A        meta: %7Btype: 'text', name: 'summary'%7D,%0A        temp: %7BdisplayType: 'summary'%7D,%0A        text: 'Lorem',%0A        flavor: 'plain-text'%0A      %7D);%0A    expect(newShapes%5B2%5D)%0A      .to.deep.equal(%7B%0A        meta: %7Btype: 'text', name: 'disclaimer'%7D,%0A        temp: %7BdisplayType: 'summary'%7D,%0A        text: 'Not my fault',%0A        flavor: 'strawberry'%0A      %7D);%0A  %7D);%0A%7D);

Test text part handler.