Skip to content

Commit

Permalink
Adopt another test from Unexpected.
Browse files Browse the repository at this point in the history
  • Loading branch information
papandreou committed Jun 23, 2016
1 parent a5dcda4 commit 93484f7
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions test/unexpected-magicpen.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,29 @@ describe('magicpen type', function () {
});
});
});

describe('magicPen style', function () {
it('renders a raw entry', function () {
expect(expect.createOutput('text').raw('foo'), 'to inspect as', "magicpen('text').raw('foo') // foo");
});

it('renders an empty block', function () {
expect(
expect.createOutput('text').block(function () {}),
'to inspect as',
"magicpen('text').block(function () {}) // "
);
});

it('renders text with an empty array of styles', function () {
expect(expect.createOutput('text').text('foo', []), 'to inspect as', "magicpen('text').text('foo', []) // foo");
});

it('renders text with a single style not defined as a top-level style', function () {
expect(expect.createOutput('text').text('foo', ['blabla']), 'to inspect as', "magicpen('text').text('foo', [ 'blabla' ]) // foo");
});

it('renders text with several styles', function () {
expect(expect.createOutput('text').text('foo', ['quux', 'baz']), 'to inspect as', "magicpen('text').text('foo', [ 'quux', 'baz' ]) // foo");
});
});

0 comments on commit 93484f7

Please sign in to comment.