|
|
@@ -401,6 +401,16 @@ describe( 'Schema', () => {
|
|
|
expect( schema.isObject( 'foo' ) ).to.be.true;
|
|
|
} );
|
|
|
|
|
|
+ it( 'returns true if an item is a limit, selectable, and a content at once (but not explicitely an object)', () => {
|
|
|
+ schema.register( 'foo', {
|
|
|
+ isLimit: true,
|
|
|
+ isSelectable: true,
|
|
|
+ isContent: true
|
|
|
+ } );
|
|
|
+
|
|
|
+ expect( schema.isObject( 'foo' ) ).to.be.true;
|
|
|
+ } );
|
|
|
+
|
|
|
it( 'returns false if an item was registered as a limit (because not all limits are objects)', () => {
|
|
|
schema.register( 'foo', {
|
|
|
isLimit: true
|
|
|
@@ -409,6 +419,39 @@ describe( 'Schema', () => {
|
|
|
expect( schema.isObject( 'foo' ) ).to.be.false;
|
|
|
} );
|
|
|
|
|
|
+ it( 'returns false if an item is a limit and a selectable but not a content ' +
|
|
|
+ '(because an object must always find its way into data regardless of its children)',
|
|
|
+ () => {
|
|
|
+ schema.register( 'foo', {
|
|
|
+ isLimit: true,
|
|
|
+ isSelectable: true
|
|
|
+ } );
|
|
|
+
|
|
|
+ expect( schema.isObject( 'foo' ) ).to.be.false;
|
|
|
+ } );
|
|
|
+
|
|
|
+ it( 'returns false if an item is a limit and content but not a selectable ' +
|
|
|
+ '(because the user must always be able to select an object)',
|
|
|
+ () => {
|
|
|
+ schema.register( 'foo', {
|
|
|
+ isLimit: true,
|
|
|
+ isContent: true
|
|
|
+ } );
|
|
|
+
|
|
|
+ expect( schema.isObject( 'foo' ) ).to.be.false;
|
|
|
+ } );
|
|
|
+
|
|
|
+ it( 'returns false if an item is a selectable and a content but not a limit ' +
|
|
|
+ '(because an object should never be split or crossed by the selection)',
|
|
|
+ () => {
|
|
|
+ schema.register( 'foo', {
|
|
|
+ isSelectable: true,
|
|
|
+ isContent: true
|
|
|
+ } );
|
|
|
+
|
|
|
+ expect( schema.isObject( 'foo' ) ).to.be.false;
|
|
|
+ } );
|
|
|
+
|
|
|
it( 'returns false if an item was not registered as an object', () => {
|
|
|
schema.register( 'foo' );
|
|
|
|