Commit 9a4cd28a authored by Robert Knight's avatar Robert Knight

Remove `-util` suffix from modules in src/sidebar/util

Fix a naming inconsistency for modules in src/sidebar/util where some
had a `-util` suffix and some did not.
parent a2918f28
...@@ -6,7 +6,7 @@ const serviceConfig = require('../service-config'); ...@@ -6,7 +6,7 @@ const serviceConfig = require('../service-config');
const bridgeEvents = require('../../shared/bridge-events'); const bridgeEvents = require('../../shared/bridge-events');
const uiConstants = require('../ui-constants'); const uiConstants = require('../ui-constants');
const isSidebar = require('../util/is-sidebar'); const isSidebar = require('../util/is-sidebar');
const { shouldAutoDisplayTutorial } = require('../util/session-util'); const { shouldAutoDisplayTutorial } = require('../util/session');
/** /**
* Return the user's authentication status from their profile. * Return the user's authentication status from their profile.
......
...@@ -6,7 +6,7 @@ const { createElement } = require('preact'); ...@@ -6,7 +6,7 @@ const { createElement } = require('preact');
const { Fragment } = require('preact'); const { Fragment } = require('preact');
const NewNoteBtn = require('./new-note-btn'); const NewNoteBtn = require('./new-note-btn');
const sessionUtil = require('../util/session-util'); const sessionUtil = require('../util/session');
const uiConstants = require('../ui-constants'); const uiConstants = require('../ui-constants');
const useStore = require('../store/use-store'); const useStore = require('../store/use-store');
const { withServices } = require('../util/service-context'); const { withServices } = require('../util/service-context');
......
...@@ -49,7 +49,7 @@ describe('sidebar.components.hypothesis-app', function() { ...@@ -49,7 +49,7 @@ describe('sidebar.components.hypothesis-app', function() {
hypothesisApp.$imports.$mock({ hypothesisApp.$imports.$mock({
'../util/is-sidebar': fakeIsSidebar, '../util/is-sidebar': fakeIsSidebar,
'../service-config': fakeServiceConfig, '../service-config': fakeServiceConfig,
'../util/session-util': { '../util/session': {
shouldAutoDisplayTutorial: fakeShouldAutoDisplayTutorial, shouldAutoDisplayTutorial: fakeShouldAutoDisplayTutorial,
}, },
}); });
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
const get = require('lodash.get'); const get = require('lodash.get');
const queryString = require('query-string'); const queryString = require('query-string');
const { replaceURLParams } = require('../util/url-util'); const { replaceURLParams } = require('../util/url');
/** /**
* Translate the response from a failed API call into an Error-like object. * Translate the response from a failed API call into an Error-like object.
......
...@@ -14,7 +14,7 @@ const DEFAULT_ORGANIZATION = { ...@@ -14,7 +14,7 @@ const DEFAULT_ORGANIZATION = {
}; };
const events = require('../events'); const events = require('../events');
const { awaitStateChange } = require('../util/state-util'); const { awaitStateChange } = require('../util/state');
const { combineGroups } = require('../util/groups'); const { combineGroups } = require('../util/groups');
const serviceConfig = require('../service-config'); const serviceConfig = require('../service-config');
......
'use strict'; 'use strict';
const events = require('../events'); const events = require('../events');
const resolve = require('../util/url-util').resolve; const resolve = require('../util/url').resolve;
const serviceConfig = require('../service-config'); const serviceConfig = require('../service-config');
/** /**
......
'use strict'; 'use strict';
const urlUtil = require('../util/url-util'); const urlUtil = require('../util/url');
/** /**
* A function that returns an absolute URL given a link name and params, by * A function that returns an absolute URL given a link name and params, by
......
...@@ -21,7 +21,7 @@ function createServiceUrl(linksPromise) { ...@@ -21,7 +21,7 @@ function createServiceUrl(linksPromise) {
.returns({ url: 'EXPANDED_URL', params: {} }); .returns({ url: 'EXPANDED_URL', params: {} });
serviceUrlFactory.$imports.$mock({ serviceUrlFactory.$imports.$mock({
'../util/url-util': { replaceURLParams: replaceURLParams }, '../util/url': { replaceURLParams: replaceURLParams },
}); });
const store = fakeStore(); const store = fakeStore();
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
const { createSelector } = require('reselect'); const { createSelector } = require('reselect');
const arrayUtil = require('../../util/array-util'); const arrayUtil = require('../../util/array');
const metadata = require('../../util/annotation-metadata'); const metadata = require('../../util/annotation-metadata');
const uiConstants = require('../../ui-constants'); const uiConstants = require('../../ui-constants');
......
...@@ -19,9 +19,9 @@ ...@@ -19,9 +19,9 @@
const { createSelector } = require('reselect'); const { createSelector } = require('reselect');
const immutable = require('seamless-immutable'); const immutable = require('seamless-immutable');
const arrayUtil = require('../../util/array-util'); const arrayUtil = require('../../util/array');
const metadata = require('../../util/annotation-metadata'); const metadata = require('../../util/annotation-metadata');
const toSet = require('../../util/array-util').toSet; const toSet = require('../../util/array').toSet;
const uiConstants = require('../../ui-constants'); const uiConstants = require('../../ui-constants');
const util = require('../util'); const util = require('../util');
......
'use strict'; 'use strict';
const sessionUtil = require('../session-util'); const sessionUtil = require('../session');
describe('sidebar.util.session-util', () => { describe('sidebar/util/session', () => {
describe('#shouldShowSidebarTutorial', () => { describe('#shouldShowSidebarTutorial', () => {
it('shows sidebar tutorial if the settings object has the show_sidebar_tutorial key set', function() { it('shows sidebar tutorial if the settings object has the show_sidebar_tutorial key set', function() {
const sessionState = { const sessionState = {
......
'use strict'; 'use strict';
const fakeStore = require('../../test/fake-redux-store'); const fakeStore = require('../../test/fake-redux-store');
const stateUtil = require('../state-util'); const stateUtil = require('../state');
describe('state-util', function() { describe('sidebar/util/state', function() {
let store; let store;
beforeEach(function() { beforeEach(function() {
......
'use strict'; 'use strict';
const urlUtil = require('../url-util'); const urlUtil = require('../url');
describe('url-util', function() { describe('sidebar/util/url', function() {
describe('replaceURLParams()', function() { describe('replaceURLParams()', function() {
it('should replace params in URLs', function() { it('should replace params in URLs', function() {
const replaced = urlUtil.replaceURLParams('http://foo.com/things/:id', { const replaced = urlUtil.replaceURLParams('http://foo.com/things/:id', {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment