Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Code style: fix code issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
jodator committed Feb 24, 2020
2 parents 76e85fb + 64f6c79 commit 425eb05
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/utils/viewtoplaintext.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ import viewToPlainText from '../../src/utils/viewtoplaintext';
import { parse as parseView } from '@ckeditor/ckeditor5-engine/src/dev-utils/view';

describe( 'viewToPlainText()', () => {
function test( viewString, expectedText ) {
function testViewToPlainText( viewString, expectedText ) {
const view = parseView( viewString );
const text = viewToPlainText( view );

expect( text ).to.equal( expectedText );
}

it( 'should output text contents of given view', () => {
test(
testViewToPlainText(
'<container:p>Foo<strong>Bar</strong>Xyz</container:p>',
'FooBarXyz'
);
} );

it( 'should put empty line between container elements', () => {
test(
testViewToPlainText(
'<container:h1>Header</container:h1>' +
'<container:p>Foo</container:p>' +
'<container:p>Bar</container:p>' +
Expand All @@ -35,7 +35,7 @@ describe( 'viewToPlainText()', () => {
} );

it( 'should output alt attribute of image elements', () => {
test(
testViewToPlainText(
'<container:p>Foo</container:p>' +
'<img src="foo.jpg" alt="Alt" />',

Expand All @@ -44,7 +44,7 @@ describe( 'viewToPlainText()', () => {
} );

it( 'should not put empty line after li (if not needed)', () => {
test(
testViewToPlainText(
'<container:p>Foo</container:p>' +
'<container:ul>' +
'<container:li>A</container:li>' +
Expand All @@ -58,7 +58,7 @@ describe( 'viewToPlainText()', () => {
} );

it( 'should not put empty line before/after figcaption (if not needed)', () => {
test(
testViewToPlainText(
'<container:p>Foo</container:p>' +
'<container:figure>' +
'<img src="foo.jpg" alt="Alt" />' +
Expand Down

0 comments on commit 425eb05

Please sign in to comment.