Skip to content

Commit

Permalink
Update: Changing analytics client name to 'box-content-preview' (#79)
Browse files Browse the repository at this point in the history
- Previous name 'Box Content Preview' was causing issues due to the spaces
- Changed to match name of package
  • Loading branch information
tonyjin authored Apr 17, 2017
1 parent a36f735 commit 983dda9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build/webpack.common.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ module.exports = (language) => {
}),
new I18nPlugin(langJson),
new DefinePlugin({
__NAME__: JSON.stringify(pkg.description),
__NAME__: JSON.stringify(pkg.name),
__VERSION__: JSON.stringify(pkg.version),
'process.env': {
NODE_ENV: JSON.stringify(process.env.NODE_ENV),
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "box-content-preview",
"version": "0.119.1",
"description": "Box Content Preview",
"description": "Box Content Preview UI Kit",
"author": "Box (https://www.box.com/)",
"license": "Box Software Development Kit License Agreement",
"repository": {
Expand Down
8 changes: 4 additions & 4 deletions src/lib/__tests__/util-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ describe('lib/util', () => {
expect(headers.foo).to.equal(fooHeader);
expect(headers.Authorization).to.equal(`Bearer ${token}`);
expect(headers.BoxApi).to.equal(`shared_link=${sharedLink}`);
expect(headers['X-Box-Client-Name']).to.equal('Box Content Preview');
expect(headers['X-Box-Client-Name']).to.equal('box-content-preview');
expect(headers['X-Box-Client-Version']).to.equal(__VERSION__);
});

Expand All @@ -230,7 +230,7 @@ describe('lib/util', () => {
assert.equal(headers.foo, 'bar');
assert.equal(headers.Authorization, 'Bearer token');
assert.equal(headers.BoxApi, 'shared_link=https://sharename&shared_link_password=password');
assert.equal(headers['X-Box-Client-Name'], 'Box Content Preview');
assert.equal(headers['X-Box-Client-Name'], 'box-content-preview');
assert.equal(headers['X-Box-Client-Version'], __VERSION__);
});
});
Expand All @@ -245,15 +245,15 @@ describe('lib/util', () => {
const url = 'foo';
const token = 'sometoken';
const sharedLink = 'someSharedLink';
expect(util.appendAuthParams(url, token, sharedLink)).to.equal(`${url}?access_token=${token}&shared_link=${sharedLink}&box_client_name=Box%20Content%20Preview&box_client_version=${__VERSION__}`);
expect(util.appendAuthParams(url, token, sharedLink)).to.equal(`${url}?access_token=${token}&shared_link=${sharedLink}&box_client_name=box-content-preview&box_client_version=${__VERSION__}`);
});

it('should return correct url with password', () => {
const url = 'foobar';
const token = 'sometoken';
const sharedLink = 'someSharedLink';
const sharedLinkPassword = 'somePass';
expect(util.appendAuthParams(url, token, sharedLink, sharedLinkPassword)).to.equal(`foobar?access_token=${token}&shared_link=${sharedLink}&shared_link_password=${sharedLinkPassword}&box_client_name=Box%20Content%20Preview&box_client_version=${__VERSION__}`);
expect(util.appendAuthParams(url, token, sharedLink, sharedLinkPassword)).to.equal(`foobar?access_token=${token}&shared_link=${sharedLink}&shared_link_password=${sharedLinkPassword}&box_client_name=box-content-preview&box_client_version=${__VERSION__}`);
});
});
/* eslint-enable no-undef */
Expand Down
4 changes: 2 additions & 2 deletions src/lib/viewers/text/__tests__/CSVViewer-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('lib/viewers/text/CSVViewer', () => {
});

beforeEach(() => {
fixture.load('viewers/text/__tests__/CSV-test.html');
fixture.load('viewers/text/__tests__/CSVViewer-test.html');
containerEl = document.querySelector('.container');
options = {
container: containerEl,
Expand Down Expand Up @@ -90,7 +90,7 @@ describe('lib/viewers/text/CSVViewer', () => {

sandbox.stub(util, 'get').returns(Promise.resolve());

const csvUrlWithAuth = `csvUrl?access_token=token&shared_link=sharedLink&shared_link_password=sharedLinkPassword&box_client_name=Box%20Content%20Preview&box_client_version=${__VERSION__}`;
const csvUrlWithAuth = `csvUrl?access_token=token&shared_link=sharedLink&shared_link_password=sharedLinkPassword&box_client_name=box-content-preview&box_client_version=${__VERSION__}`;

return csv.load().then(() => {
expect(window.Papa.parse).to.be.calledWith(csvUrlWithAuth, {
Expand Down

0 comments on commit 983dda9

Please sign in to comment.