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

Commit

Permalink
Code style.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mgsy committed Aug 7, 2018
1 parent 2fa6fd0 commit c68cb11
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 250 deletions.
104 changes: 26 additions & 78 deletions tests/model/operation/transform/attribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph>BarFo<$text italic="true">o</$text></paragraph>'
);
expectClients( '<paragraph>BarFo<$text italic="true">o</$text></paragraph>' );
} );
} );

Expand Down Expand Up @@ -460,9 +458,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph>oFo</paragraph>'
);
expectClients( '<paragraph>oFo</paragraph>' );
} );

it( 'remove attribute from element in same path', () => {
Expand All @@ -474,9 +470,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph>oFo</paragraph>'
);
expectClients( '<paragraph>oFo</paragraph>' );
} );

it( 'remove attribute from text with 2 attributes in same path', () => {
Expand All @@ -488,9 +482,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph><$text italic="true">o</$text>Fo</paragraph>'
);
expectClients( '<paragraph><$text italic="true">o</$text>Fo</paragraph>' );
} );

it( 'remove attribute from text in other user\'s selection', () => {
Expand Down Expand Up @@ -655,9 +647,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph><$text bold="true">Foo</$text></paragraph>'
);
expectClients( '<paragraph><$text bold="true">Foo</$text></paragraph>' );
} );

it( 'element in same path #2', () => {
Expand All @@ -681,9 +671,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<blockQuote><$text bold="true">Foo</$text></blockQuote>'
);
expectClients( '<blockQuote><$text bold="true">Foo</$text></blockQuote>' );
} );
} );

Expand Down Expand Up @@ -806,9 +794,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph><$text bold="true">Fo</$text></paragraph>'
);
expectClients( '<paragraph><$text bold="true">Fo</$text></paragraph>' );
} );

it( 'text in other user\'s selection', () => {
Expand All @@ -820,9 +806,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph><$text bold="true">F</$text></paragraph>'
);
expectClients( '<paragraph><$text bold="true">F</$text></paragraph>' );
} );

it( 'remove attribute from element in different path', () => {
Expand Down Expand Up @@ -864,9 +848,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph>o</paragraph>'
);
expectClients( '<paragraph>o</paragraph>' );
} );

it( 'remove attribute from element in same path', () => {
Expand All @@ -878,9 +860,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph>o</paragraph>'
);
expectClients( '<paragraph>o</paragraph>' );
} );

it( 'remove attribute from text with 2 attributes in same path', () => {
Expand All @@ -892,9 +872,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph><$text italic="true">o</$text></paragraph>'
);
expectClients( '<paragraph><$text italic="true">o</$text></paragraph>' );
} );

it( 'remove attribute from text in other user\'s selection', () => {
Expand All @@ -906,9 +884,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph></paragraph>'
);
expectClients( '<paragraph></paragraph>' );
} );
} );

Expand Down Expand Up @@ -952,9 +928,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph><$text bold="true">Fo</$text>o</paragraph>'
);
expectClients( '<paragraph><$text bold="true">Fo</$text>o</paragraph>' );
} );

it( 'from element in same path', () => {
Expand All @@ -978,9 +952,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph><$text bold="true">Fo</$text><$text italic="true">o</$text></paragraph>'
);
expectClients( '<paragraph><$text bold="true">Fo</$text><$text italic="true">o</$text></paragraph>' );
} );

it( 'from text in other user\'s selection', () => {
Expand All @@ -992,9 +964,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph><$text italic="true">Foo</$text></paragraph>'
);
expectClients( '<paragraph><$text italic="true">Foo</$text></paragraph>' );
} );
} );

Expand Down Expand Up @@ -1126,9 +1096,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph><m1:start></m1:start>Fo<m1:end></m1:end>o</paragraph>'
);
expectClients( '<paragraph><m1:start></m1:start>Fo<m1:end></m1:end>o</paragraph>' );
} );

it( 'remove attribute from text in same path, then undo', () => {
Expand All @@ -1144,9 +1112,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph><m1:start></m1:start>Fo<m1:end></m1:end><$text bold="true">o</$text></paragraph>'
);
expectClients( '<paragraph><m1:start></m1:start>Fo<m1:end></m1:end><$text bold="true">o</$text></paragraph>' );
} );

it( 'remove attribute from text with 2 attributes in same path', () => {
Expand All @@ -1158,9 +1124,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph><m1:start></m1:start>Fo<m1:end></m1:end><$text italic="true">o</$text></paragraph>'
);
expectClients( '<paragraph><m1:start></m1:start>Fo<m1:end></m1:end><$text italic="true">o</$text></paragraph>' );
} );

it( 'remove attribute from text in other user\'s selection', () => {
Expand All @@ -1172,9 +1136,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph><m1:start></m1:start>Foo<m1:end></m1:end></paragraph>'
);
expectClients( '<paragraph><m1:start></m1:start>Foo<m1:end></m1:end></paragraph>' );
} );
} );

Expand Down Expand Up @@ -1234,9 +1196,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<heading1><$text bold="true">Foo Bar</$text></heading1>'
);
expectClients( '<heading1><$text bold="true">Foo Bar</$text></heading1>' );
} );

it( 'element in user\'s selection', () => {
Expand All @@ -1248,9 +1208,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<heading1><$text bold="true">Foo</$text></heading1>'
);
expectClients( '<heading1><$text bold="true">Foo</$text></heading1>' );
} );

it( 'element in user\'s selection, then undo', () => {
Expand All @@ -1267,9 +1225,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph>Foo</paragraph>'
);
expectClients( '<paragraph>Foo</paragraph>' );
} );

it( 'remove attribute from element in different path', () => {
Expand Down Expand Up @@ -1311,9 +1267,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<heading1>Foo</heading1>'
);
expectClients( '<heading1>Foo</heading1>' );
} );

it( 'remove attribute from element in same path', () => {
Expand All @@ -1325,9 +1279,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<heading1>Foo</heading1>'
);
expectClients( '<heading1>Foo</heading1>' );
} );

it( 'remove attribute from text with 2 attributes in same path', () => {
Expand All @@ -1339,9 +1291,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<heading1>Fo<$text italic="true">o</$text></heading1>'
);
expectClients( '<heading1>Fo<$text italic="true">o</$text></heading1>' );
} );

it( 'remove attribute from text in other user\'s selection', () => {
Expand All @@ -1353,9 +1303,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<heading1>Foo</heading1>'
);
expectClients( '<heading1>Foo</heading1>' );
} );
} );
} );
36 changes: 9 additions & 27 deletions tests/model/operation/transform/insert.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph></paragraph>'
);
expectClients( '<paragraph></paragraph>' );
} );
} );

Expand Down Expand Up @@ -486,9 +484,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph>FooAbc</paragraph><paragraph>Bar</paragraph>'
);
expectClients( '<paragraph>FooAbc</paragraph><paragraph>Bar</paragraph>' );
} );

it( 'text in different path', () => {
Expand All @@ -500,9 +496,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph>FooAbc</paragraph><blockQuote>Bar</blockQuote>'
);
expectClients( '<paragraph>FooAbc</paragraph><blockQuote>Bar</blockQuote>' );
} );

it( 'element in same path #1', () => {
Expand All @@ -514,9 +508,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph>Foo Bar</paragraph>'
);
expectClients( '<paragraph>Foo Bar</paragraph>' );
} );

it( 'element in same path #2', () => {
Expand All @@ -543,9 +535,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<blockQuote>Foo Bar</blockQuote>'
);
expectClients( '<blockQuote>Foo Bar</blockQuote>' );
} );

it( 'element, then insert text and move', () => {
Expand Down Expand Up @@ -770,9 +760,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph>FooAbc</paragraph><paragraph></paragraph>'
);
expectClients( '<paragraph>FooAbc</paragraph><paragraph></paragraph>' );
} );

it( 'text in same path', () => {
Expand All @@ -784,9 +772,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph>Bar</paragraph>'
);
expectClients( '<paragraph>Bar</paragraph>' );
} );

it( 'element in different path', () => {
Expand Down Expand Up @@ -931,9 +917,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph>Foo Bar</paragraph>'
);
expectClients( '<paragraph>Foo Bar</paragraph>' );
} );
} );

Expand Down Expand Up @@ -978,9 +962,7 @@ describe( 'transform', () => {

syncClients();

expectClients(
'<paragraph>BarFo<m1:start></m1:start>o<m1:end></m1:end></paragraph>'
);
expectClients( '<paragraph>BarFo<m1:start></m1:start>o<m1:end></m1:end></paragraph>' );
} );
} );

Expand Down
Loading

0 comments on commit c68cb11

Please sign in to comment.