From 9f914ab62ca9c0724aaa957b0a1df1105ba75baf Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Tue, 31 Jul 2018 16:16:40 +0100 Subject: [PATCH] Small naming convetion tweaks --- .../src/components/page-attributes/parent.js | 4 +-- packages/url/src/test/index.test.js | 26 +++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/editor/src/components/page-attributes/parent.js b/packages/editor/src/components/page-attributes/parent.js index e07ed64e2c79a..ed9ab45218089 100644 --- a/packages/editor/src/components/page-attributes/parent.js +++ b/packages/editor/src/components/page-attributes/parent.js @@ -65,7 +65,7 @@ const applyWithDispatch = withDispatch( ( dispatch ) => { const applyWithAPIDataItems = withAPIData( ( { postType, postId } ) => { const isHierarchical = get( postType, [ 'hierarchical' ], false ); const restBase = get( postType, [ 'rest_base' ], false ); - const queryString = { + const query = { context: 'edit', per_page: -1, exclude: postId, @@ -75,7 +75,7 @@ const applyWithAPIDataItems = withAPIData( ( { postType, postId } ) => { order: 'asc', }; return isHierarchical && restBase ? - { items: addQueryArgs( `/wp/v2/${ restBase }`, queryString ) } : + { items: addQueryArgs( `/wp/v2/${ restBase }`, query ) } : {}; } ); diff --git a/packages/url/src/test/index.test.js b/packages/url/src/test/index.test.js index 0bd8b81abe446..40fbc4fe20d53 100644 --- a/packages/url/src/test/index.test.js +++ b/packages/url/src/test/index.test.js @@ -4,28 +4,28 @@ import { addQueryArgs, prependHTTP } from '../'; describe( 'addQueryArgs', () => { - test( 'should append args to an URL without query string', () => { + it( 'should append args to an URL without query string', () => { const url = 'https://andalouses.example/beach'; const args = { sun: 'true', sand: 'false' }; expect( addQueryArgs( url, args ) ).toBe( 'https://andalouses.example/beach?sun=true&sand=false' ); } ); - test( 'should append args to an URL with query string', () => { + it( 'should append args to an URL with query string', () => { const url = 'https://andalouses.example/beach?night=false'; const args = { sun: 'true', sand: 'false' }; expect( addQueryArgs( url, args ) ).toBe( 'https://andalouses.example/beach?night=false&sun=true&sand=false' ); } ); - test( 'should update args to an URL with conflicting query string', () => { + it( 'should update args to an URL with conflicting query string', () => { const url = 'https://andalouses.example/beach?night=false&sun=false&sand=true'; const args = { sun: 'true', sand: 'false' }; expect( addQueryArgs( url, args ) ).toBe( 'https://andalouses.example/beach?night=false&sun=true&sand=false' ); } ); - test( 'should update args to an URL with array parameters', () => { + it( 'should update args to an URL with array parameters', () => { const url = 'https://andalouses.example/beach?time[]=10&time[]=11'; const args = { beach: [ 'sand', 'rock' ] }; @@ -34,55 +34,55 @@ describe( 'addQueryArgs', () => { } ); describe( 'prependHTTP', () => { - test( 'should prepend http to a domain', () => { + it( 'should prepend http to a domain', () => { const url = 'wordpress.org'; expect( prependHTTP( url ) ).toBe( 'http://' + url ); } ); - test( 'shouldn’t prepend http to an email', () => { + it( 'shouldn’t prepend http to an email', () => { const url = 'foo@wordpress.org'; expect( prependHTTP( url ) ).toBe( url ); } ); - test( 'shouldn’t prepend http to an absolute URL', () => { + it( 'shouldn’t prepend http to an absolute URL', () => { const url = '/wordpress'; expect( prependHTTP( url ) ).toBe( url ); } ); - test( 'shouldn’t prepend http to a relative URL', () => { + it( 'shouldn’t prepend http to a relative URL', () => { const url = './wordpress'; expect( prependHTTP( url ) ).toBe( url ); } ); - test( 'shouldn’t prepend http to an anchor URL', () => { + it( 'shouldn’t prepend http to an anchor URL', () => { const url = '#wordpress'; expect( prependHTTP( url ) ).toBe( url ); } ); - test( 'shouldn’t prepend http to a URL that already has http', () => { + it( 'shouldn’t prepend http to a URL that already has http', () => { const url = 'http://wordpress.org'; expect( prependHTTP( url ) ).toBe( url ); } ); - test( 'shouldn’t prepend http to a URL that already has https', () => { + it( 'shouldn’t prepend http to a URL that already has https', () => { const url = 'https://wordpress.org'; expect( prependHTTP( url ) ).toBe( url ); } ); - test( 'shouldn’t prepend http to a URL that already has ftp', () => { + it( 'shouldn’t prepend http to a URL that already has ftp', () => { const url = 'ftp://wordpress.org'; expect( prependHTTP( url ) ).toBe( url ); } ); - test( 'shouldn’t prepend http to a URL that already has mailto', () => { + it( 'shouldn’t prepend http to a URL that already has mailto', () => { const url = 'mailto:foo@wordpress.org'; expect( prependHTTP( url ) ).toBe( url );