Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/disco/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ export const validInstallStates = [
];

// Add-on types.
export const THEME_TYPE = 'Theme';
export const EXTENSION_TYPE = 'Extension';
export const EXTENSION_TYPE = 'extension';
export const THEME_TYPE = 'theme';
// These types are not used.
// export const DICT_TYPE = 'dictionary';
// export const SEARCH_TYPE = 'search';
// export const LPAPP_TYPE = 'language';
// export const PERSONA_TYPE = 'persona';
export const validAddonTypes = [
THEME_TYPE,
EXTENSION_TYPE,
THEME_TYPE,
];

// Theme preview actions.
Expand Down
4 changes: 2 additions & 2 deletions src/disco/fakeData.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default {
name: 'Japanese Tattoo',
slug: 'japanese-tattoo',
sub_heading: null,
type: 'Theme',
type: 'theme',
url: `${amoHost}/en-US/firefox/addon/japanese-tattoo/`,
installURL: 'https://addons.mozilla.org/en-US/firefox/addon/10900/',
themeURL: `${amoCDN}/user-media/addons/18781/preview_large.jpg?1239806327`,
Expand All @@ -32,7 +32,7 @@ export default {
'addon-287841-latest.xpi?src=dp-btn-primary',
name: 'Awesome Screenshot Plus - Capture, Annotate & More',
slug: 'awesome-screenshot-capture-',
type: 'Extension',
type: 'extension',
url: `${amoHost}/en-US/firefox/addon/awesome-screenshot-capture-/`,
},
},
Expand Down
10 changes: 5 additions & 5 deletions tests/client/disco/components/TestAddon.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { stubAddonManager } from 'tests/client/helpers';

const result = {
id: 'test-id',
type: 'Extension',
type: 'extension',
heading: 'test-heading',
slug: 'test-slug',
subHeading: 'test-sub-heading',
Expand All @@ -35,7 +35,7 @@ describe('<Addon />', () => {
stubAddonManager();
});

describe('<Addon type="Extension"/>', () => {
describe('<Addon type="extension"/>', () => {
let root;

beforeEach(() => {
Expand Down Expand Up @@ -97,11 +97,11 @@ describe('<Addon />', () => {
});


describe('<Addon type="Theme"/>', () => {
describe('<Addon type="theme"/>', () => {
let root;

beforeEach(() => {
const data = {...result, type: 'Theme'};
const data = {...result, type: 'theme'};
root = renderAddon(data);
});

Expand All @@ -122,7 +122,7 @@ describe('<Addon />', () => {

beforeEach(() => {
themeAction = sinon.stub();
const data = {...result, type: 'Theme', themeAction};
const data = {...result, type: 'theme', themeAction};
root = renderAddon(data);
themeImage = findDOMNode(root).querySelector('.theme-image');
});
Expand Down
14 changes: 7 additions & 7 deletions tests/client/search/containers/TestAddonPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ describe('AddonPage', () => {
name: 'Addon!',
slug: 'my-addon',
summary: 'My add-on',
status: 'Fully Reviewed',
status: 'public',
tags: [],
type: 'Extension',
type: 'extension',
url: 'https://addons.mozilla.org/firefox/addon/my-addon/',
edit_url: 'https://addons.mozilla.org/developers/addon/my-addon/edit',
review_url: 'https://addons.mozilla.org/en-US/editors/review/1865',
Expand Down Expand Up @@ -51,8 +51,8 @@ describe('AddonPage', () => {
files: [
{
id: 54321,
platform: 'Linux',
status: 'Fully Reviewed',
platform: 'linux',
status: 'public',
size: 556677,
created: '2016-04-01T12:11:10',
url: 'https://addons.mozilla.org/files/54321',
Expand Down Expand Up @@ -93,7 +93,7 @@ describe('AddonPage', () => {
const infoText = info.map((infum) => infum.textContent);
assert.deepEqual(
infoText,
['Extension', 'Fully Reviewed', 'View on site', 'Edit on site', 'View on editors',
['extension', 'public', 'View on site', 'Edit on site', 'View on editors',
'View homepage', 'Email support', 'View support site']);
});

Expand Down Expand Up @@ -150,7 +150,7 @@ describe('AddonPage', () => {
.from(root.querySelector('.addon--file-info').childNodes)
.map((infum) => infum.textContent);
assert.deepEqual(
file, ['Linux', 'Fully Reviewed', '556677 bytes', '2016-04-01T12:11:10', 'Download']);
file, ['linux', 'public', '556677 bytes', '2016-04-01T12:11:10', 'Download']);
});
});

Expand All @@ -167,7 +167,7 @@ describe('AddonPage', () => {
const infoText = info.map((infum) => infum.textContent);
assert.deepEqual(
infoText,
['Extension', 'Fully Reviewed', 'View on site', 'Edit on site', 'View on editors']);
['extension', 'public', 'View on site', 'Edit on site', 'View on editors']);
});

it('does not render the tags', () => {
Expand Down