diff --git a/README.md b/README.md index 20f5fe78a3..07f2087943 100644 --- a/README.md +++ b/README.md @@ -87,7 +87,7 @@ Alternatively, you can start the test runner with a [specific file or regular expression](https://facebook.github.io/jest/docs/en/cli.html#jest-regexfortestfiles), like: ``` -yarn test tests/client/amo/components/TestAddonDetail.js +yarn test tests/unit/amo/components/TestAddonDetail.js ``` #### Run all tests diff --git a/jest.config.js b/jest.config.js index 2e280d4660..7926af6c89 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,9 +1,9 @@ module.exports = { + collectCoverageFrom: ['src/**/*.{js,jsx}'], coveragePathIgnorePatterns: [ '/node_modules/', '/src/core/server/webpack-isomorphic-tools-config.js', - '/tests/', - '/config/', + '/src/locale/', ], moduleDirectories: [ 'src', diff --git a/package.json b/package.json index 0d4bba8844..88645c0967 100644 --- a/package.json +++ b/package.json @@ -174,9 +174,7 @@ "babel-preset-stage-2": "^6.24.1", "babel-register": "^6.24.1", "bundle-loader": "^0.5.5", - "chai": "^3.5.0", "chalk": "^1.1.3", - "cheerio": "^0.22.0", "chokidar-cli": "^1.2.0", "concurrently": "^3.4.0", "content-security-policy-parser": "^0.1.0", diff --git a/tests/server/helpers.js b/tests/server/helpers.js deleted file mode 100644 index 9b20b92248..0000000000 --- a/tests/server/helpers.js +++ /dev/null @@ -1,45 +0,0 @@ -import cheerio from 'cheerio'; -import { camelizeKeys as camelCaseKeys } from 'humps'; - -import { runServer } from 'core/server/base'; - -export function checkSRI(res) { - const $ = cheerio.load(res.text); - const $stylesheets = $('link[rel=stylesheet]'); - expect($stylesheets.length > 0).toBeTruthy(); - $stylesheets.each((i, elem) => { - const $elem = $(elem); - expect($elem.attr('integrity')).toContain('sha512'); - expect($elem.attr('crossorigin')).toEqual('anonymous'); - }); - - const $script = $('script[src]'); - expect($script.length > 0).toBeTruthy(); - $script.each((i, elem) => { - const $elem = $(elem); - if ($elem.attr('src').includes('analytics.js')) { - throw new Error('Google analytics should not be included in server tests.'); - } - expect($elem.attr('integrity')).toContain('sha512'); - expect($elem.attr('crossorigin')).toEqual('anonymous'); - }); -} - -export function parseCSP(rawCsp) { - return camelCaseKeys( - rawCsp - .split(';') - .map((part) => part.trim().split(' ')) - .reduce((parts, [partName, ...partValues]) => ({ - ...parts, - [partName]: partValues, - }), {})); -} - -export function runTestServer(options = {}) { - return runServer({ - listen: false, - exitProcess: false, - ...options, - }); -} diff --git a/tests/server/test_helpers.js b/tests/server/test_helpers.js deleted file mode 100644 index cd7ea8ab88..0000000000 --- a/tests/server/test_helpers.js +++ /dev/null @@ -1,22 +0,0 @@ -import { oneLine } from 'common-tags'; - -import { parseCSP } from './helpers'; - -describe('server test helpers', () => { - describe('parseCSP', () => { - it('parses the CSP header into an object', () => { - const headerContent = oneLine`default-src 'none'; base-uri 'self'; child-src 'none'; - connect-src 'self' https://addons-dev-cdn.allizom.org 127.0.0.1:3001; form-action 'none'; - frame-src 'none'; img-src 'self' 127.0.0.1:3001; media-src - https://addons-discovery.cdn.mozilla.net; object-src 'none'; script-src 'self' - https://addons-dev-cdn.allizom.org 127.0.0.1:3001; style-src 'self' blob: - 'sha256-8VVSrUT/1AZpxCZNGwNROSnacmbseuppeBCace7a/Wc='; report-uri /__cspreport__`; - const policy = parseCSP(headerContent); - expect(policy.imgSrc).toEqual(["'self'", '127.0.0.1:3001']); - expect(policy.styleSrc).toEqual( - ["'self'", 'blob:', "'sha256-8VVSrUT/1AZpxCZNGwNROSnacmbseuppeBCace7a/Wc='"] - ); - expect(policy.reportUri).toEqual(['/__cspreport__']); - }); - }); -}); diff --git a/tests/server/TestCSPConfig.js b/tests/unit/TestCSPConfig.js similarity index 100% rename from tests/server/TestCSPConfig.js rename to tests/unit/TestCSPConfig.js diff --git a/tests/server/TestConfig.js b/tests/unit/TestConfig.js similarity index 100% rename from tests/server/TestConfig.js rename to tests/unit/TestConfig.js diff --git a/tests/server/TestFrameGuardConfig.js b/tests/unit/TestFrameGuardConfig.js similarity index 100% rename from tests/server/TestFrameGuardConfig.js rename to tests/unit/TestFrameGuardConfig.js diff --git a/tests/server/TestLocalesConfig.js b/tests/unit/TestLocalesConfig.js similarity index 100% rename from tests/server/TestLocalesConfig.js rename to tests/unit/TestLocalesConfig.js diff --git a/tests/client/TestPackageJson.js b/tests/unit/TestPackageJson.js similarity index 100% rename from tests/client/TestPackageJson.js rename to tests/unit/TestPackageJson.js diff --git a/tests/server/TestSriDataPlugin.js b/tests/unit/TestSriDataPlugin.js similarity index 100% rename from tests/server/TestSriDataPlugin.js rename to tests/unit/TestSriDataPlugin.js diff --git a/tests/client/amo/actions/testReviews.js b/tests/unit/amo/actions/testReviews.js similarity index 96% rename from tests/client/amo/actions/testReviews.js rename to tests/unit/amo/actions/testReviews.js index e3392ef8a6..487f328d53 100644 --- a/tests/client/amo/actions/testReviews.js +++ b/tests/unit/amo/actions/testReviews.js @@ -5,7 +5,7 @@ import { setAddonReviews, } from 'amo/actions/reviews'; import { SET_REVIEW } from 'amo/constants'; -import { fakeAddon, fakeReview } from 'tests/client/amo/helpers'; +import { fakeAddon, fakeReview } from 'tests/unit/amo/helpers'; // See reducer tests for more coverage of review actions. describe('amo.actions.reviews', () => { diff --git a/tests/client/amo/actions/test_featured.js b/tests/unit/amo/actions/test_featured.js similarity index 100% rename from tests/client/amo/actions/test_featured.js rename to tests/unit/amo/actions/test_featured.js diff --git a/tests/client/amo/actions/test_landing.js b/tests/unit/amo/actions/test_landing.js similarity index 100% rename from tests/client/amo/actions/test_landing.js rename to tests/unit/amo/actions/test_landing.js diff --git a/tests/client/amo/components/TestAddonCompatibilityError.js b/tests/unit/amo/components/TestAddonCompatibilityError.js similarity index 97% rename from tests/client/amo/components/TestAddonCompatibilityError.js rename to tests/unit/amo/components/TestAddonCompatibilityError.js index e55daa5d2f..30c4730e1b 100644 --- a/tests/client/amo/components/TestAddonCompatibilityError.js +++ b/tests/unit/amo/components/TestAddonCompatibilityError.js @@ -14,8 +14,8 @@ import { INCOMPATIBLE_NOT_FIREFOX, INCOMPATIBLE_UNDER_MIN_VERSION, } from 'core/constants'; -import { signedInApiState } from 'tests/client/amo/helpers'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { signedInApiState } from 'tests/unit/amo/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; import I18nProvider from 'core/i18n/Provider'; diff --git a/tests/client/amo/components/TestAddonDetail.js b/tests/unit/amo/components/TestAddonDetail.js similarity index 99% rename from tests/client/amo/components/TestAddonDetail.js rename to tests/unit/amo/components/TestAddonDetail.js index 4ba3a3f40a..ad229ae167 100644 --- a/tests/client/amo/components/TestAddonDetail.js +++ b/tests/unit/amo/components/TestAddonDetail.js @@ -26,8 +26,8 @@ import { } from 'core/constants'; import InstallButton from 'core/components/InstallButton'; import I18nProvider from 'core/i18n/Provider'; -import { fakeAddon, signedInApiState } from 'tests/client/amo/helpers'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { fakeAddon, signedInApiState } from 'tests/unit/amo/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; function renderProps({ addon = fakeAddon, setCurrentStatus = sinon.spy(), ...customProps } = {}) { diff --git a/tests/client/amo/components/TestAddonMeta.js b/tests/unit/amo/components/TestAddonMeta.js similarity index 96% rename from tests/client/amo/components/TestAddonMeta.js rename to tests/unit/amo/components/TestAddonMeta.js index 24af4b346e..93bb79f2f9 100644 --- a/tests/client/amo/components/TestAddonMeta.js +++ b/tests/unit/amo/components/TestAddonMeta.js @@ -7,8 +7,8 @@ import { findDOMNode } from 'react-dom'; import AddonMeta from 'amo/components/AddonMeta'; import I18nProvider from 'core/i18n/Provider'; -import { fakeAddon } from 'tests/client/amo/helpers'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { fakeAddon } from 'tests/unit/amo/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; function render({ ...customProps } = {}) { const props = { diff --git a/tests/client/amo/components/TestAddonMoreInfo.js b/tests/unit/amo/components/TestAddonMoreInfo.js similarity index 97% rename from tests/client/amo/components/TestAddonMoreInfo.js rename to tests/unit/amo/components/TestAddonMoreInfo.js index 8a78e0bb55..945b31df6f 100644 --- a/tests/client/amo/components/TestAddonMoreInfo.js +++ b/tests/unit/amo/components/TestAddonMoreInfo.js @@ -9,8 +9,8 @@ import { Provider } from 'react-redux'; import createStore from 'amo/store'; import { AddonMoreInfoBase } from 'amo/components/AddonMoreInfo'; -import { fakeAddon } from 'tests/client/amo/helpers'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { fakeAddon } from 'tests/unit/amo/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; describe('', () => { diff --git a/tests/client/amo/components/TestAddonReview.js b/tests/unit/amo/components/TestAddonReview.js similarity index 98% rename from tests/client/amo/components/TestAddonReview.js rename to tests/unit/amo/components/TestAddonReview.js index 558d54133b..8d0c2ac03a 100644 --- a/tests/client/amo/components/TestAddonReview.js +++ b/tests/unit/amo/components/TestAddonReview.js @@ -14,8 +14,8 @@ import { mapDispatchToProps, mapStateToProps, AddonReviewBase, } from 'amo/components/AddonReview'; import { ErrorHandler } from 'core/errorHandler'; -import { fakeAddon, fakeReview, signedInApiState } from 'tests/client/amo/helpers'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { fakeAddon, fakeReview, signedInApiState } from 'tests/unit/amo/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; const defaultReview = { id: 3321, addonId: fakeAddon.id, addonSlug: fakeAddon.slug, rating: 5, diff --git a/tests/client/amo/components/TestAddonReviewList.js b/tests/unit/amo/components/TestAddonReviewList.js similarity index 99% rename from tests/client/amo/components/TestAddonReviewList.js rename to tests/unit/amo/components/TestAddonReviewList.js index 3c085c4ca7..8bfa6656f3 100644 --- a/tests/client/amo/components/TestAddonReviewList.js +++ b/tests/unit/amo/components/TestAddonReviewList.js @@ -26,10 +26,10 @@ import { denormalizeAddon } from 'core/reducers/addons'; import { initialApiState } from 'core/reducers/api'; import I18nProvider from 'core/i18n/Provider'; import Rating from 'ui/components/Rating'; -import { fakeAddon, fakeReview } from 'tests/client/amo/helpers'; +import { fakeAddon, fakeReview } from 'tests/unit/amo/helpers'; import { apiResponsePage, getFakeI18nInst, unexpectedSuccess, -} from 'tests/client/helpers'; +} from 'tests/unit/helpers'; function getLoadedReviews({ addonSlug = fakeAddon.slug, reviews = [fakeReview], reviewCount = 1 } = {}, diff --git a/tests/client/amo/components/TestAddonsCard.js b/tests/unit/amo/components/TestAddonsCard.js similarity index 95% rename from tests/client/amo/components/TestAddonsCard.js rename to tests/unit/amo/components/TestAddonsCard.js index 2be5d0643f..daffbad7be 100644 --- a/tests/client/amo/components/TestAddonsCard.js +++ b/tests/unit/amo/components/TestAddonsCard.js @@ -2,7 +2,7 @@ import React from 'react'; import AddonsCard from 'amo/components/AddonsCard'; import SearchResult from 'amo/components/SearchResult'; -import { shallowRender } from 'tests/client/helpers'; +import { shallowRender } from 'tests/unit/helpers'; describe('', () => { diff --git a/tests/client/amo/components/TestCategories.js b/tests/unit/amo/components/TestCategories.js similarity index 98% rename from tests/client/amo/components/TestCategories.js rename to tests/unit/amo/components/TestCategories.js index 8fea278f33..b3b86d55b7 100644 --- a/tests/client/amo/components/TestCategories.js +++ b/tests/unit/amo/components/TestCategories.js @@ -11,7 +11,7 @@ import { CategoriesBase, mapStateToProps } from 'amo/components/Categories'; import { setClientApp, setLang } from 'core/actions'; import { categoriesLoad } from 'core/actions/categories'; import { ADDON_TYPE_EXTENSION, CLIENT_APP_ANDROID } from 'core/constants'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; const categoriesResponse = { diff --git a/tests/client/amo/components/TestFeaturedAddons.js b/tests/unit/amo/components/TestFeaturedAddons.js similarity index 93% rename from tests/client/amo/components/TestFeaturedAddons.js rename to tests/unit/amo/components/TestFeaturedAddons.js index 08d3e062b4..a5b33ae1f5 100644 --- a/tests/client/amo/components/TestFeaturedAddons.js +++ b/tests/unit/amo/components/TestFeaturedAddons.js @@ -7,8 +7,8 @@ import { } from 'amo/components/FeaturedAddons'; import createStore from 'amo/store'; import { ADDON_TYPE_EXTENSION, ADDON_TYPE_THEME } from 'core/constants'; -import { fakeAddon, signedInApiState } from 'tests/client/amo/helpers'; -import { getFakeI18nInst, shallowRender } from 'tests/client/helpers'; +import { fakeAddon, signedInApiState } from 'tests/unit/amo/helpers'; +import { getFakeI18nInst, shallowRender } from 'tests/unit/helpers'; describe('', () => { diff --git a/tests/client/amo/components/TestFooter.js b/tests/unit/amo/components/TestFooter.js similarity index 96% rename from tests/client/amo/components/TestFooter.js rename to tests/unit/amo/components/TestFooter.js index 79cdbf732c..0b3959ff6a 100644 --- a/tests/client/amo/components/TestFooter.js +++ b/tests/unit/amo/components/TestFooter.js @@ -8,7 +8,7 @@ import { Provider } from 'react-redux'; import Footer from 'amo/components/Footer'; import createStore from 'amo/store'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; import I18nProvider from 'core/i18n/Provider'; diff --git a/tests/client/amo/components/TestLandingPage.js b/tests/unit/amo/components/TestLandingPage.js similarity index 97% rename from tests/client/amo/components/TestLandingPage.js rename to tests/unit/amo/components/TestLandingPage.js index 3b1e1e5280..96de2adb7f 100644 --- a/tests/client/amo/components/TestLandingPage.js +++ b/tests/unit/amo/components/TestLandingPage.js @@ -17,8 +17,8 @@ import { } from 'core/constants'; import I18nProvider from 'core/i18n/Provider'; import { visibleAddonType } from 'core/utils'; -import { fakeAddon } from 'tests/client/amo/helpers'; -import { getFakeI18nInst, shallowRender } from 'tests/client/helpers'; +import { fakeAddon } from 'tests/unit/amo/helpers'; +import { getFakeI18nInst, shallowRender } from 'tests/unit/helpers'; describe('', () => { diff --git a/tests/client/amo/components/TestLanguagePicker.js b/tests/unit/amo/components/TestLanguagePicker.js similarity index 97% rename from tests/client/amo/components/TestLanguagePicker.js rename to tests/unit/amo/components/TestLanguagePicker.js index 87be19c781..6d53a14909 100644 --- a/tests/client/amo/components/TestLanguagePicker.js +++ b/tests/unit/amo/components/TestLanguagePicker.js @@ -12,7 +12,7 @@ import { LanguagePickerBase, changeLocaleURL, } from 'amo/components/LanguagePicker'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; describe('LanguagePicker', () => { diff --git a/tests/client/amo/components/TestLink.js b/tests/unit/amo/components/TestLink.js similarity index 100% rename from tests/client/amo/components/TestLink.js rename to tests/unit/amo/components/TestLink.js diff --git a/tests/client/amo/components/TestMastHead.js b/tests/unit/amo/components/TestMastHead.js similarity index 97% rename from tests/client/amo/components/TestMastHead.js rename to tests/unit/amo/components/TestMastHead.js index e22efe645f..de02765c13 100644 --- a/tests/client/amo/components/TestMastHead.js +++ b/tests/unit/amo/components/TestMastHead.js @@ -8,7 +8,7 @@ import { Provider } from 'react-redux'; import createStore from 'amo/store'; import { MastHeadBase } from 'amo/components/MastHead'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; import translate from 'core/i18n/translate'; import I18nProvider from 'core/i18n/Provider'; diff --git a/tests/client/amo/components/TestNotAuthorized.js b/tests/unit/amo/components/TestNotAuthorized.js similarity index 90% rename from tests/client/amo/components/TestNotAuthorized.js rename to tests/unit/amo/components/TestNotAuthorized.js index bd6bbc59fe..c233cd7909 100644 --- a/tests/client/amo/components/TestNotAuthorized.js +++ b/tests/unit/amo/components/TestNotAuthorized.js @@ -11,8 +11,8 @@ import NotAuthorized from 'amo/components/ErrorPage/NotAuthorized'; import createStore from 'amo/store'; import { createApiError } from 'core/api'; import I18nProvider from 'core/i18n/Provider'; -import { signedInApiState } from 'tests/client/amo/helpers'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { signedInApiState } from 'tests/unit/amo/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; describe('', () => { diff --git a/tests/client/amo/components/TestNotFound.js b/tests/unit/amo/components/TestNotFound.js similarity index 90% rename from tests/client/amo/components/TestNotFound.js rename to tests/unit/amo/components/TestNotFound.js index ddab21e362..32082c0f11 100644 --- a/tests/client/amo/components/TestNotFound.js +++ b/tests/unit/amo/components/TestNotFound.js @@ -11,8 +11,8 @@ import NotFound from 'amo/components/ErrorPage/NotFound'; import createStore from 'amo/store'; import { createApiError } from 'core/api'; import I18nProvider from 'core/i18n/Provider'; -import { signedInApiState } from 'tests/client/amo/helpers'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { signedInApiState } from 'tests/unit/amo/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; describe('', () => { diff --git a/tests/client/amo/components/TestRatingManager.js b/tests/unit/amo/components/TestRatingManager.js similarity index 99% rename from tests/client/amo/components/TestRatingManager.js rename to tests/unit/amo/components/TestRatingManager.js index 3085c5b064..070054da60 100644 --- a/tests/client/amo/components/TestRatingManager.js +++ b/tests/unit/amo/components/TestRatingManager.js @@ -23,8 +23,8 @@ import { } from 'amo/components/RatingManager'; import { fakeAddon, fakeReview, signedInApiState, -} from 'tests/client/amo/helpers'; -import { getFakeI18nInst, userAuthToken } from 'tests/client/helpers'; +} from 'tests/unit/amo/helpers'; +import { getFakeI18nInst, userAuthToken } from 'tests/unit/helpers'; function render(customProps = {}) { const props = { diff --git a/tests/client/amo/components/TestScreenShots.js b/tests/unit/amo/components/TestScreenShots.js similarity index 97% rename from tests/client/amo/components/TestScreenShots.js rename to tests/unit/amo/components/TestScreenShots.js index 63472aaeec..5f0f48ea63 100644 --- a/tests/client/amo/components/TestScreenShots.js +++ b/tests/unit/amo/components/TestScreenShots.js @@ -3,7 +3,7 @@ import { renderIntoDocument } from 'react-addons-test-utils'; import { PhotoSwipeGallery } from 'react-photoswipe'; import ScreenShots, { thumbnailContent } from 'amo/components/ScreenShots'; -import { shallowRender } from 'tests/client/helpers'; +import { shallowRender } from 'tests/unit/helpers'; describe('', () => { const previews = [ diff --git a/tests/client/amo/components/TestSearchForm.js b/tests/unit/amo/components/TestSearchForm.js similarity index 98% rename from tests/client/amo/components/TestSearchForm.js rename to tests/unit/amo/components/TestSearchForm.js index 37da8fd4aa..5ff8e32baa 100644 --- a/tests/client/amo/components/TestSearchForm.js +++ b/tests/unit/amo/components/TestSearchForm.js @@ -8,7 +8,7 @@ import { mapDispatchToProps, mapStateToProps, } from 'amo/components/SearchForm'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; describe('', () => { diff --git a/tests/client/amo/components/TestSearchPage.js b/tests/unit/amo/components/TestSearchPage.js similarity index 97% rename from tests/client/amo/components/TestSearchPage.js rename to tests/unit/amo/components/TestSearchPage.js index 79895a2956..55d2e7fd83 100644 --- a/tests/client/amo/components/TestSearchPage.js +++ b/tests/unit/amo/components/TestSearchPage.js @@ -4,7 +4,7 @@ import SearchPage from 'amo/components/SearchPage'; import SearchResults from 'amo/components/SearchResults'; import SearchSort from 'amo/components/SearchSort'; import Paginate from 'core/components/Paginate'; -import { findAllByTag, findByTag, shallowRender } from 'tests/client/helpers'; +import { findAllByTag, findByTag, shallowRender } from 'tests/unit/helpers'; describe('', () => { diff --git a/tests/client/amo/components/TestSearchResult.js b/tests/unit/amo/components/TestSearchResult.js similarity index 97% rename from tests/client/amo/components/TestSearchResult.js rename to tests/unit/amo/components/TestSearchResult.js index e5710125cc..84c1aabeb4 100644 --- a/tests/client/amo/components/TestSearchResult.js +++ b/tests/unit/amo/components/TestSearchResult.js @@ -10,8 +10,8 @@ import { Provider } from 'react-redux'; import createStore from 'amo/store'; import SearchResult from 'amo/components/SearchResult'; import I18nProvider from 'core/i18n/Provider'; -import { fakeAddon } from 'tests/client/amo/helpers'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { fakeAddon } from 'tests/unit/amo/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; import { ADDON_TYPE_THEME } from 'core/constants'; diff --git a/tests/client/amo/components/TestSearchResults.js b/tests/unit/amo/components/TestSearchResults.js similarity index 95% rename from tests/client/amo/components/TestSearchResults.js rename to tests/unit/amo/components/TestSearchResults.js index 83cf935b15..7807bc5c98 100644 --- a/tests/client/amo/components/TestSearchResults.js +++ b/tests/unit/amo/components/TestSearchResults.js @@ -8,8 +8,8 @@ import { Provider } from 'react-redux'; import createStore from 'amo/store'; import SearchResults from 'amo/components/SearchResults'; import I18nProvider from 'core/i18n/Provider'; -import { fakeAddon } from 'tests/client/amo/helpers'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { fakeAddon } from 'tests/unit/amo/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; describe('', () => { diff --git a/tests/client/amo/components/TestSearchSort.js b/tests/unit/amo/components/TestSearchSort.js similarity index 97% rename from tests/client/amo/components/TestSearchSort.js rename to tests/unit/amo/components/TestSearchSort.js index 9e92d23724..b08af38346 100644 --- a/tests/client/amo/components/TestSearchSort.js +++ b/tests/unit/amo/components/TestSearchSort.js @@ -10,7 +10,7 @@ import { Provider } from 'react-redux'; import createStore from 'amo/store'; import I18nProvider from 'core/i18n/Provider'; import SearchSort from 'amo/components/SearchSort'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; function render(props) { diff --git a/tests/client/amo/components/TestServerError.js b/tests/unit/amo/components/TestServerError.js similarity index 90% rename from tests/client/amo/components/TestServerError.js rename to tests/unit/amo/components/TestServerError.js index 51cc4d207c..2a6300124c 100644 --- a/tests/client/amo/components/TestServerError.js +++ b/tests/unit/amo/components/TestServerError.js @@ -11,8 +11,8 @@ import ServerError from 'amo/components/ErrorPage/ServerError'; import createStore from 'amo/store'; import { createApiError } from 'core/api'; import I18nProvider from 'core/i18n/Provider'; -import { signedInApiState } from 'tests/client/amo/helpers'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { signedInApiState } from 'tests/unit/amo/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; describe('', () => { diff --git a/tests/client/amo/components/TestSuggestedPages.js b/tests/unit/amo/components/TestSuggestedPages.js similarity index 94% rename from tests/client/amo/components/TestSuggestedPages.js rename to tests/unit/amo/components/TestSuggestedPages.js index 7bc63722fa..2efde82d19 100644 --- a/tests/client/amo/components/TestSuggestedPages.js +++ b/tests/unit/amo/components/TestSuggestedPages.js @@ -9,7 +9,7 @@ import { Provider } from 'react-redux'; import SuggestedPages from 'amo/components/SuggestedPages'; import createStore from 'amo/store'; import I18nProvider from 'core/i18n/Provider'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; describe('', () => { diff --git a/tests/client/amo/containers/TestApp.js b/tests/unit/amo/containers/TestApp.js similarity index 99% rename from tests/client/amo/containers/TestApp.js rename to tests/unit/amo/containers/TestApp.js index d078ddea3c..8eaeff3f2b 100644 --- a/tests/client/amo/containers/TestApp.js +++ b/tests/unit/amo/containers/TestApp.js @@ -23,7 +23,7 @@ import { createApiError } from 'core/api'; import DefaultErrorPage from 'core/components/ErrorPage'; import { INSTALL_STATE, maximumSetTimeoutDelay } from 'core/constants'; import I18nProvider from 'core/i18n/Provider'; -import { getFakeI18nInst, userAuthToken } from 'tests/client/helpers'; +import { getFakeI18nInst, userAuthToken } from 'tests/unit/helpers'; describe('App', () => { diff --git a/tests/client/amo/containers/TestCategoryPage.js b/tests/unit/amo/containers/TestCategoryPage.js similarity index 97% rename from tests/client/amo/containers/TestCategoryPage.js rename to tests/unit/amo/containers/TestCategoryPage.js index 31399b1b30..2f9036af68 100644 --- a/tests/client/amo/containers/TestCategoryPage.js +++ b/tests/unit/amo/containers/TestCategoryPage.js @@ -4,7 +4,7 @@ import { CategoryPageBase, mapStateToProps } from 'amo/containers/CategoryPage'; import createStore from 'amo/store'; import { searchStart } from 'core/actions/search'; import { ADDON_TYPE_THEME } from 'core/constants'; -import { shallowRender } from 'tests/client/helpers'; +import { shallowRender } from 'tests/unit/helpers'; describe('CategoryPage', () => { diff --git a/tests/client/amo/containers/TestDetail.js b/tests/unit/amo/containers/TestDetail.js similarity index 93% rename from tests/client/amo/containers/TestDetail.js rename to tests/unit/amo/containers/TestDetail.js index 08892e3d7e..4a62b4954f 100644 --- a/tests/client/amo/containers/TestDetail.js +++ b/tests/unit/amo/containers/TestDetail.js @@ -3,8 +3,8 @@ import React from 'react'; import { DetailPageBase, mapStateToProps } from 'amo/containers/DetailPage'; import AddonDetail from 'amo/components/AddonDetail'; import { INSTALLED, UNKNOWN } from 'core/constants'; -import { fakeAddon } from 'tests/client/amo/helpers'; -import { shallowRender } from 'tests/client/helpers'; +import { fakeAddon } from 'tests/unit/amo/helpers'; +import { shallowRender } from 'tests/unit/helpers'; describe('DetailPage', () => { diff --git a/tests/client/amo/containers/TestHome.js b/tests/unit/amo/containers/TestHome.js similarity index 94% rename from tests/client/amo/containers/TestHome.js rename to tests/unit/amo/containers/TestHome.js index 303200c4ef..d6ee1eb627 100644 --- a/tests/client/amo/containers/TestHome.js +++ b/tests/unit/amo/containers/TestHome.js @@ -7,7 +7,7 @@ import { import { Provider } from 'react-redux'; import createStore from 'amo/store'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; import Home from 'amo/containers/Home'; diff --git a/tests/client/amo/containers/TestSearch.js b/tests/unit/amo/containers/TestSearch.js similarity index 98% rename from tests/client/amo/containers/TestSearch.js rename to tests/unit/amo/containers/TestSearch.js index 54594b05c9..b85f626967 100644 --- a/tests/client/amo/containers/TestSearch.js +++ b/tests/unit/amo/containers/TestSearch.js @@ -6,7 +6,7 @@ import { parsePage, } from 'core/searchUtils'; import * as api from 'core/api'; -import { signedInApiState } from 'tests/client/amo/helpers'; +import { signedInApiState } from 'tests/unit/amo/helpers'; describe('Search.mapStateToProps()', () => { const state = { diff --git a/tests/client/amo/helpers.js b/tests/unit/amo/helpers.js similarity index 100% rename from tests/client/amo/helpers.js rename to tests/unit/amo/helpers.js diff --git a/tests/client/amo/reducers/testFeatured.js b/tests/unit/amo/reducers/testFeatured.js similarity index 100% rename from tests/client/amo/reducers/testFeatured.js rename to tests/unit/amo/reducers/testFeatured.js diff --git a/tests/client/amo/reducers/testLanding.js b/tests/unit/amo/reducers/testLanding.js similarity index 100% rename from tests/client/amo/reducers/testLanding.js rename to tests/unit/amo/reducers/testLanding.js diff --git a/tests/client/amo/reducers/testReviews.js b/tests/unit/amo/reducers/testReviews.js similarity index 98% rename from tests/client/amo/reducers/testReviews.js rename to tests/unit/amo/reducers/testReviews.js index b1844638f0..992194126b 100644 --- a/tests/client/amo/reducers/testReviews.js +++ b/tests/unit/amo/reducers/testReviews.js @@ -1,6 +1,6 @@ import { setAddonReviews, setReview } from 'amo/actions/reviews'; import reviews, { initialState } from 'amo/reducers/reviews'; -import { fakeAddon, fakeReview } from 'tests/client/amo/helpers'; +import { fakeAddon, fakeReview } from 'tests/unit/amo/helpers'; describe('amo.reducers.reviews', () => { function setFakeReview({ diff --git a/tests/client/amo/sagas/testCategories.js b/tests/unit/amo/sagas/testCategories.js similarity index 100% rename from tests/client/amo/sagas/testCategories.js rename to tests/unit/amo/sagas/testCategories.js diff --git a/tests/client/amo/sagas/testIndex.js b/tests/unit/amo/sagas/testIndex.js similarity index 100% rename from tests/client/amo/sagas/testIndex.js rename to tests/unit/amo/sagas/testIndex.js diff --git a/tests/client/amo/sagas/testUtils.js b/tests/unit/amo/sagas/testUtils.js similarity index 100% rename from tests/client/amo/sagas/testUtils.js rename to tests/unit/amo/sagas/testUtils.js diff --git a/tests/client/amo/testApi.js b/tests/unit/amo/testApi.js similarity index 98% rename from tests/client/amo/testApi.js rename to tests/unit/amo/testApi.js index 4bd3493678..bba4f806eb 100644 --- a/tests/client/amo/testApi.js +++ b/tests/unit/amo/testApi.js @@ -4,8 +4,8 @@ import { submitReview, } from 'amo/api'; import * as api from 'core/api'; -import { unexpectedSuccess } from 'tests/client/helpers'; -import { fakeReview, signedInApiState } from 'tests/client/amo/helpers'; +import { unexpectedSuccess } from 'tests/unit/helpers'; +import { fakeReview, signedInApiState } from 'tests/unit/amo/helpers'; describe('amo.api', () => { let mockApi; diff --git a/tests/client/amo/test_store.js b/tests/unit/amo/test_store.js similarity index 100% rename from tests/client/amo/test_store.js rename to tests/unit/amo/test_store.js diff --git a/tests/client/amo/test_utils.js b/tests/unit/amo/test_utils.js similarity index 98% rename from tests/client/amo/test_utils.js rename to tests/unit/amo/test_utils.js index 984bb3f7d9..01434eae94 100644 --- a/tests/client/amo/test_utils.js +++ b/tests/unit/amo/test_utils.js @@ -17,7 +17,7 @@ import { loadFeaturedAddons, loadLandingAddons, } from 'amo/utils'; -import { unexpectedSuccess } from 'tests/client/helpers'; +import { unexpectedSuccess } from 'tests/unit/helpers'; describe('amo/utils', () => { diff --git a/tests/client/core/TestAddonManager.js b/tests/unit/core/TestAddonManager.js similarity index 99% rename from tests/client/core/TestAddonManager.js rename to tests/unit/core/TestAddonManager.js index 32ae69a53d..f8e3e21cdd 100644 --- a/tests/client/core/TestAddonManager.js +++ b/tests/unit/core/TestAddonManager.js @@ -5,7 +5,7 @@ import { INSTALL_EVENT_LIST, SET_ENABLE_NOT_AVAILABLE, } from 'core/constants'; -import { unexpectedSuccess } from 'tests/client/helpers'; +import { unexpectedSuccess } from 'tests/unit/helpers'; describe('addonManager', () => { diff --git a/tests/client/core/TestInstallAddon.js b/tests/unit/core/TestInstallAddon.js similarity index 99% rename from tests/client/core/TestInstallAddon.js rename to tests/unit/core/TestInstallAddon.js index 387b43a23a..53596c2b8b 100644 --- a/tests/client/core/TestInstallAddon.js +++ b/tests/unit/core/TestInstallAddon.js @@ -34,7 +34,7 @@ import { } from 'core/constants'; import { getFakeAddonManagerWrapper, shallowRender, -} from 'tests/client/helpers'; +} from 'tests/unit/helpers'; import * as installAddon from 'core/installAddon'; import * as themePreview from 'core/themePreview'; diff --git a/tests/client/core/TestLocalState.js b/tests/unit/core/TestLocalState.js similarity index 98% rename from tests/client/core/TestLocalState.js rename to tests/unit/core/TestLocalState.js index 93f4f75dce..48a93826eb 100644 --- a/tests/client/core/TestLocalState.js +++ b/tests/unit/core/TestLocalState.js @@ -1,5 +1,5 @@ import createLocalState, { configureLocalForage } from 'core/localState'; -import { unexpectedSuccess } from 'tests/client/helpers'; +import { unexpectedSuccess } from 'tests/unit/helpers'; function fakeLocalForage(overrides = {}) { return { diff --git a/tests/client/core/TestThemePreview.js b/tests/unit/core/TestThemePreview.js similarity index 100% rename from tests/client/core/TestThemePreview.js rename to tests/unit/core/TestThemePreview.js diff --git a/tests/client/core/actions/test_categories.js b/tests/unit/core/actions/test_categories.js similarity index 100% rename from tests/client/core/actions/test_categories.js rename to tests/unit/core/actions/test_categories.js diff --git a/tests/client/core/actions/test_errors.js b/tests/unit/core/actions/test_errors.js similarity index 100% rename from tests/client/core/actions/test_errors.js rename to tests/unit/core/actions/test_errors.js diff --git a/tests/client/core/actions/test_index.js b/tests/unit/core/actions/test_index.js similarity index 96% rename from tests/client/core/actions/test_index.js rename to tests/unit/core/actions/test_index.js index df840d85a8..31c35cb296 100644 --- a/tests/client/core/actions/test_index.js +++ b/tests/unit/core/actions/test_index.js @@ -1,5 +1,5 @@ import * as actions from 'core/actions'; -import { userAgents } from 'tests/client/helpers'; +import { userAgents } from 'tests/unit/helpers'; describe('core actions setAuthToken', () => { diff --git a/tests/client/core/actions/test_search.js b/tests/unit/core/actions/test_search.js similarity index 100% rename from tests/client/core/actions/test_search.js rename to tests/unit/core/actions/test_search.js diff --git a/tests/client/core/api/test_api.js b/tests/unit/core/api/test_api.js similarity index 99% rename from tests/client/core/api/test_api.js rename to tests/unit/core/api/test_api.js index f5b96aa9d3..7f6df2935c 100644 --- a/tests/client/core/api/test_api.js +++ b/tests/unit/core/api/test_api.js @@ -8,7 +8,7 @@ import * as api from 'core/api'; import { ADDON_TYPE_THEME } from 'core/constants'; import { ErrorHandler } from 'core/errorHandler'; import { signedInApiState, unexpectedSuccess, userAuthToken } - from 'tests/client/helpers'; + from 'tests/unit/helpers'; export function generateHeaders( diff --git a/tests/client/core/client/test_client_config.js b/tests/unit/core/client/test_client_config.js similarity index 100% rename from tests/client/core/client/test_client_config.js rename to tests/unit/core/client/test_client_config.js diff --git a/tests/client/core/client/test_logger.js b/tests/unit/core/client/test_logger.js similarity index 100% rename from tests/client/core/client/test_logger.js rename to tests/unit/core/client/test_logger.js diff --git a/tests/client/core/components/.gitkeep b/tests/unit/core/components/.gitkeep similarity index 100% rename from tests/client/core/components/.gitkeep rename to tests/unit/core/components/.gitkeep diff --git a/tests/client/core/components/TestAuthenticateButton.js b/tests/unit/core/components/TestAuthenticateButton.js similarity index 98% rename from tests/client/core/components/TestAuthenticateButton.js rename to tests/unit/core/components/TestAuthenticateButton.js index c276fef77d..490c0b430b 100644 --- a/tests/client/core/components/TestAuthenticateButton.js +++ b/tests/unit/core/components/TestAuthenticateButton.js @@ -14,7 +14,7 @@ import { mapStateToProps, } from 'core/components/AuthenticateButton'; import apiReducer from 'core/reducers/api'; -import { getFakeI18nInst, userAuthToken } from 'tests/client/helpers'; +import { getFakeI18nInst, userAuthToken } from 'tests/unit/helpers'; import Icon from 'ui/components/Icon'; function createStore() { diff --git a/tests/client/core/components/TestErrorPage.js b/tests/unit/core/components/TestErrorPage.js similarity index 93% rename from tests/client/core/components/TestErrorPage.js rename to tests/unit/core/components/TestErrorPage.js index 9d9d2b0c34..0060499993 100644 --- a/tests/client/core/components/TestErrorPage.js +++ b/tests/unit/core/components/TestErrorPage.js @@ -10,9 +10,9 @@ import { loadFail } from 'redux-connect/lib/store'; import ErrorPage, { mapStateToProps } from 'core/components/ErrorPage'; import createStore from 'amo/store'; import { createApiError } from 'core/api'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; import I18nProvider from 'core/i18n/Provider'; -import { signedInApiState } from 'tests/client/amo/helpers'; +import { signedInApiState } from 'tests/unit/amo/helpers'; describe('', () => { diff --git a/tests/client/core/components/TestHoverIntent.js b/tests/unit/core/components/TestHoverIntent.js similarity index 100% rename from tests/client/core/components/TestHoverIntent.js rename to tests/unit/core/components/TestHoverIntent.js diff --git a/tests/client/core/components/TestInstallButton.js b/tests/unit/core/components/TestInstallButton.js similarity index 98% rename from tests/client/core/components/TestInstallButton.js rename to tests/unit/core/components/TestInstallButton.js index 826154b2be..612b86dabe 100644 --- a/tests/client/core/components/TestInstallButton.js +++ b/tests/unit/core/components/TestInstallButton.js @@ -13,8 +13,8 @@ import { UNKNOWN, } from 'core/constants'; import * as themePreview from 'core/themePreview'; -import { getFakeI18nInst, shallowRender } from 'tests/client/helpers'; -import { fakeAddon } from 'tests/client/amo/helpers'; +import { getFakeI18nInst, shallowRender } from 'tests/unit/helpers'; +import { fakeAddon } from 'tests/unit/amo/helpers'; import Button from 'ui/components/Button'; diff --git a/tests/client/core/components/TestInstallSwitch.js b/tests/unit/core/components/TestInstallSwitch.js similarity index 99% rename from tests/client/core/components/TestInstallSwitch.js rename to tests/unit/core/components/TestInstallSwitch.js index 179caf83d0..8fd3fe0321 100644 --- a/tests/client/core/components/TestInstallSwitch.js +++ b/tests/unit/core/components/TestInstallSwitch.js @@ -19,7 +19,7 @@ import { UNKNOWN, } from 'core/constants'; import * as themePreview from 'core/themePreview'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; describe('', () => { diff --git a/tests/client/core/components/TestLoginPage.js b/tests/unit/core/components/TestLoginPage.js similarity index 100% rename from tests/client/core/components/TestLoginPage.js rename to tests/unit/core/components/TestLoginPage.js diff --git a/tests/client/core/components/TestNavBar.js b/tests/unit/core/components/TestNavBar.js similarity index 96% rename from tests/client/core/components/TestNavBar.js rename to tests/unit/core/components/TestNavBar.js index baae75f9a8..4577b57a1a 100644 --- a/tests/client/core/components/TestNavBar.js +++ b/tests/unit/core/components/TestNavBar.js @@ -1,7 +1,7 @@ import React from 'react'; import { Link } from 'react-router'; -import { shallowRender } from 'tests/client/helpers'; +import { shallowRender } from 'tests/unit/helpers'; import { NavBar, NavBarButton, NavBarItem, NavBarLink } from 'core/components/NavBar'; describe('', () => { diff --git a/tests/client/core/components/TestPaginate.js b/tests/unit/core/components/TestPaginate.js similarity index 99% rename from tests/client/core/components/TestPaginate.js rename to tests/unit/core/components/TestPaginate.js index 227092caa1..31432da2f9 100644 --- a/tests/client/core/components/TestPaginate.js +++ b/tests/unit/core/components/TestPaginate.js @@ -11,7 +11,7 @@ import { Route, Router, createMemoryHistory } from 'react-router'; import Paginate from 'core/components/Paginate'; import PaginatorLink from 'core/components/PaginatorLink'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; describe('', () => { diff --git a/tests/client/core/components/TestPaginatorLink.js b/tests/unit/core/components/TestPaginatorLink.js similarity index 100% rename from tests/client/core/components/TestPaginatorLink.js rename to tests/unit/core/components/TestPaginatorLink.js diff --git a/tests/client/core/containers/TestHandleLogin.js b/tests/unit/core/containers/TestHandleLogin.js similarity index 98% rename from tests/client/core/containers/TestHandleLogin.js rename to tests/unit/core/containers/TestHandleLogin.js index 88a9230433..4bab90fa22 100644 --- a/tests/client/core/containers/TestHandleLogin.js +++ b/tests/unit/core/containers/TestHandleLogin.js @@ -12,7 +12,7 @@ import HandleLogin, { } from 'core/containers/HandleLogin'; import { setAuthToken } from 'core/actions'; import * as api from 'core/api'; -import { userAuthToken } from 'tests/client/helpers'; +import { userAuthToken } from 'tests/unit/helpers'; describe('', () => { function render(store, location, router) { diff --git a/tests/client/core/containers/TestInfoDialog.js b/tests/unit/core/containers/TestInfoDialog.js similarity index 98% rename from tests/client/core/containers/TestInfoDialog.js rename to tests/unit/core/containers/TestInfoDialog.js index fd6a8b93dc..32499f9457 100644 --- a/tests/client/core/containers/TestInfoDialog.js +++ b/tests/unit/core/containers/TestInfoDialog.js @@ -5,7 +5,7 @@ import { Simulate, renderIntoDocument } from 'react-addons-test-utils'; import ReactDOM, { findDOMNode } from 'react-dom'; import { InfoDialogBase, ShowInfoDialog, mapStateToProps } from 'core/containers/InfoDialog'; -import { getFakeI18nInst, shallowRender } from 'tests/client/helpers'; +import { getFakeI18nInst, shallowRender } from 'tests/unit/helpers'; let closeAction; diff --git a/tests/client/core/containers/TestLoginRequired.js b/tests/unit/core/containers/TestLoginRequired.js similarity index 95% rename from tests/client/core/containers/TestLoginRequired.js rename to tests/unit/core/containers/TestLoginRequired.js index 21af079e85..03951bae15 100644 --- a/tests/client/core/containers/TestLoginRequired.js +++ b/tests/unit/core/containers/TestLoginRequired.js @@ -3,7 +3,7 @@ import React from 'react'; import { mapStateToProps, LoginRequiredBase } from 'core/containers/LoginRequired'; import LoginPage from 'core/components/LoginPage'; -import { shallowRender } from 'tests/client/helpers'; +import { shallowRender } from 'tests/unit/helpers'; describe('', () => { class MyComponent extends React.Component { diff --git a/tests/client/core/containers/TestServerHtml.js b/tests/unit/core/containers/TestServerHtml.js similarity index 100% rename from tests/client/core/containers/TestServerHtml.js rename to tests/unit/core/containers/TestServerHtml.js diff --git a/tests/client/core/containers/error-simulation/TestSimulateAsyncError.js b/tests/unit/core/containers/error-simulation/TestSimulateAsyncError.js similarity index 100% rename from tests/client/core/containers/error-simulation/TestSimulateAsyncError.js rename to tests/unit/core/containers/error-simulation/TestSimulateAsyncError.js diff --git a/tests/client/core/containers/error-simulation/TestSimulateClientError.js b/tests/unit/core/containers/error-simulation/TestSimulateClientError.js similarity index 100% rename from tests/client/core/containers/error-simulation/TestSimulateClientError.js rename to tests/unit/core/containers/error-simulation/TestSimulateClientError.js diff --git a/tests/client/core/containers/error-simulation/TestSimulateSyncError.js b/tests/unit/core/containers/error-simulation/TestSimulateSyncError.js similarity index 100% rename from tests/client/core/containers/error-simulation/TestSimulateSyncError.js rename to tests/unit/core/containers/error-simulation/TestSimulateSyncError.js diff --git a/tests/client/core/i18n/TestI18nProvider.js b/tests/unit/core/i18n/TestI18nProvider.js similarity index 92% rename from tests/client/core/i18n/TestI18nProvider.js rename to tests/unit/core/i18n/TestI18nProvider.js index 90c2639bf8..c979b26ab5 100644 --- a/tests/client/core/i18n/TestI18nProvider.js +++ b/tests/unit/core/i18n/TestI18nProvider.js @@ -5,7 +5,7 @@ import { } from 'react-addons-test-utils'; import I18nProvider from 'core/i18n/Provider'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; describe('I18nProvider', () => { diff --git a/tests/client/core/i18n/test_translate.js b/tests/unit/core/i18n/test_translate.js similarity index 97% rename from tests/client/core/i18n/test_translate.js rename to tests/unit/core/i18n/test_translate.js index 1358fc9a9e..98ef105373 100644 --- a/tests/client/core/i18n/test_translate.js +++ b/tests/unit/core/i18n/test_translate.js @@ -8,7 +8,7 @@ import { import I18nProvider from 'core/i18n/Provider'; import translate from 'core/i18n/translate'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; class OuterComponent extends React.Component { diff --git a/tests/client/core/i18n/test_utils.js b/tests/unit/core/i18n/test_utils.js similarity index 100% rename from tests/client/core/i18n/test_utils.js rename to tests/unit/core/i18n/test_utils.js diff --git a/tests/client/core/middleware/test_HstsMiddleware.js b/tests/unit/core/middleware/test_HstsMiddleware.js similarity index 100% rename from tests/client/core/middleware/test_HstsMiddleware.js rename to tests/unit/core/middleware/test_HstsMiddleware.js diff --git a/tests/client/core/middleware/test_cspMiddleware.js b/tests/unit/core/middleware/test_cspMiddleware.js similarity index 100% rename from tests/client/core/middleware/test_cspMiddleware.js rename to tests/unit/core/middleware/test_cspMiddleware.js diff --git a/tests/client/core/middleware/test_frameguardMiddleware.js b/tests/unit/core/middleware/test_frameguardMiddleware.js similarity index 100% rename from tests/client/core/middleware/test_frameguardMiddleware.js rename to tests/unit/core/middleware/test_frameguardMiddleware.js diff --git a/tests/client/core/middleware/test_logRequests.js b/tests/unit/core/middleware/test_logRequests.js similarity index 100% rename from tests/client/core/middleware/test_logRequests.js rename to tests/unit/core/middleware/test_logRequests.js diff --git a/tests/client/core/middleware/test_prefixMiddleware.js b/tests/unit/core/middleware/test_prefixMiddleware.js similarity index 100% rename from tests/client/core/middleware/test_prefixMiddleware.js rename to tests/unit/core/middleware/test_prefixMiddleware.js diff --git a/tests/client/core/middleware/test_staticAssets.js b/tests/unit/core/middleware/test_staticAssets.js similarity index 100% rename from tests/client/core/middleware/test_staticAssets.js rename to tests/unit/core/middleware/test_staticAssets.js diff --git a/tests/client/core/middleware/test_trailingSlashMiddleware.js b/tests/unit/core/middleware/test_trailingSlashMiddleware.js similarity index 100% rename from tests/client/core/middleware/test_trailingSlashMiddleware.js rename to tests/unit/core/middleware/test_trailingSlashMiddleware.js diff --git a/tests/client/core/reducers/testInfoDialog.js b/tests/unit/core/reducers/testInfoDialog.js similarity index 100% rename from tests/client/core/reducers/testInfoDialog.js rename to tests/unit/core/reducers/testInfoDialog.js diff --git a/tests/client/core/reducers/test_addons.js b/tests/unit/core/reducers/test_addons.js similarity index 100% rename from tests/client/core/reducers/test_addons.js rename to tests/unit/core/reducers/test_addons.js diff --git a/tests/client/core/reducers/test_api.js b/tests/unit/core/reducers/test_api.js similarity index 98% rename from tests/client/core/reducers/test_api.js rename to tests/unit/core/reducers/test_api.js index c8f518e0ec..c0789e8482 100644 --- a/tests/client/core/reducers/test_api.js +++ b/tests/unit/core/reducers/test_api.js @@ -3,7 +3,7 @@ import UAParser from 'ua-parser-js'; import * as actions from 'core/actions'; import api, { initialApiState } from 'core/reducers/api'; import { signedInApiState, userAgents, userAuthToken } - from 'tests/client/helpers'; + from 'tests/unit/helpers'; describe('api reducer', () => { diff --git a/tests/client/core/reducers/test_authentication.js b/tests/unit/core/reducers/test_authentication.js similarity index 97% rename from tests/client/core/reducers/test_authentication.js rename to tests/unit/core/reducers/test_authentication.js index d04970abe3..208552065a 100644 --- a/tests/client/core/reducers/test_authentication.js +++ b/tests/unit/core/reducers/test_authentication.js @@ -2,7 +2,7 @@ import base64url from 'base64url'; import { setAuthToken } from 'core/actions'; import auth from 'core/reducers/authentication'; -import { userAuthToken } from 'tests/client/helpers'; +import { userAuthToken } from 'tests/unit/helpers'; describe('authentication reducer', () => { it('defaults to an empty object', () => { diff --git a/tests/client/core/reducers/test_categories.js b/tests/unit/core/reducers/test_categories.js similarity index 100% rename from tests/client/core/reducers/test_categories.js rename to tests/unit/core/reducers/test_categories.js diff --git a/tests/client/core/reducers/test_errorPage.js b/tests/unit/core/reducers/test_errorPage.js similarity index 100% rename from tests/client/core/reducers/test_errorPage.js rename to tests/unit/core/reducers/test_errorPage.js diff --git a/tests/client/core/reducers/test_errors.js b/tests/unit/core/reducers/test_errors.js similarity index 100% rename from tests/client/core/reducers/test_errors.js rename to tests/unit/core/reducers/test_errors.js diff --git a/tests/client/core/reducers/test_installations.js b/tests/unit/core/reducers/test_installations.js similarity index 100% rename from tests/client/core/reducers/test_installations.js rename to tests/unit/core/reducers/test_installations.js diff --git a/tests/client/core/reducers/test_search.js b/tests/unit/core/reducers/test_search.js similarity index 100% rename from tests/client/core/reducers/test_search.js rename to tests/unit/core/reducers/test_search.js diff --git a/tests/client/core/reducers/test_users.js b/tests/unit/core/reducers/test_users.js similarity index 100% rename from tests/client/core/reducers/test_users.js rename to tests/unit/core/reducers/test_users.js diff --git a/tests/client/core/testErrorHandler.js b/tests/unit/core/testErrorHandler.js similarity index 98% rename from tests/client/core/testErrorHandler.js rename to tests/unit/core/testErrorHandler.js index ce4c1f2526..9d1c3986d1 100644 --- a/tests/client/core/testErrorHandler.js +++ b/tests/unit/core/testErrorHandler.js @@ -13,8 +13,8 @@ import { clearError, setError } from 'core/actions/errors'; import { ErrorHandler, withErrorHandler, withErrorHandling } from 'core/errorHandler'; import errors from 'core/reducers/errors'; -import { getFakeI18nInst } from 'tests/client/helpers'; -import { createFakeApiError } from 'tests/client/core/reducers/test_errors'; +import { getFakeI18nInst } from 'tests/unit/helpers'; +import { createFakeApiError } from 'tests/unit/core/reducers/test_errors'; import ErrorList from 'ui/components/ErrorList'; class SomeComponentBase extends React.Component { diff --git a/tests/client/core/test_searchUtils.js b/tests/unit/core/test_searchUtils.js similarity index 100% rename from tests/client/core/test_searchUtils.js rename to tests/unit/core/test_searchUtils.js diff --git a/tests/client/core/test_store.js b/tests/unit/core/test_store.js similarity index 100% rename from tests/client/core/test_store.js rename to tests/unit/core/test_store.js diff --git a/tests/client/core/test_tracking.js b/tests/unit/core/test_tracking.js similarity index 100% rename from tests/client/core/test_tracking.js rename to tests/unit/core/test_tracking.js diff --git a/tests/client/core/test_utils.js b/tests/unit/core/test_utils.js similarity index 99% rename from tests/client/core/test_utils.js rename to tests/unit/core/test_utils.js index 08c0552dd4..8ab8f343cc 100644 --- a/tests/client/core/test_utils.js +++ b/tests/unit/core/test_utils.js @@ -44,9 +44,9 @@ import { } from 'core/utils'; import NotFound from 'core/components/ErrorPage/NotFound'; import I18nProvider from 'core/i18n/Provider'; -import { fakeAddon, signedInApiState } from 'tests/client/amo/helpers'; +import { fakeAddon, signedInApiState } from 'tests/unit/amo/helpers'; import { getFakeI18nInst, unexpectedSuccess, userAgents } - from 'tests/client/helpers'; + from 'tests/unit/helpers'; describe('apiAddonType', () => { diff --git a/tests/client/disco/components/TestAddon.js b/tests/unit/disco/components/TestAddon.js similarity index 99% rename from tests/client/disco/components/TestAddon.js rename to tests/unit/disco/components/TestAddon.js index 44a8861bc9..cf1840b41f 100644 --- a/tests/client/disco/components/TestAddon.js +++ b/tests/unit/disco/components/TestAddon.js @@ -29,7 +29,7 @@ import { UNINSTALLING, } from 'core/constants'; import createStore from 'disco/store'; -import { getFakeI18nInst, signedInApiState } from 'tests/client/helpers'; +import { getFakeI18nInst, signedInApiState } from 'tests/unit/helpers'; const result = { id: 'test-id', diff --git a/tests/client/disco/containers/.gitkeep b/tests/unit/disco/containers/.gitkeep similarity index 100% rename from tests/client/disco/containers/.gitkeep rename to tests/unit/disco/containers/.gitkeep diff --git a/tests/client/disco/containers/TestApp.js b/tests/unit/disco/containers/TestApp.js similarity index 98% rename from tests/client/disco/containers/TestApp.js rename to tests/unit/disco/containers/TestApp.js index 1de1be7452..c6bc8c7577 100644 --- a/tests/client/disco/containers/TestApp.js +++ b/tests/unit/disco/containers/TestApp.js @@ -11,7 +11,7 @@ import { AppBase, mapStateToProps } from 'disco/containers/App'; import createStore from 'disco/store'; import { createApiError } from 'core/api'; import I18nProvider from 'core/i18n/Provider'; -import { getFakeI18nInst } from 'tests/client/helpers'; +import { getFakeI18nInst } from 'tests/unit/helpers'; class MyComponent extends React.Component { diff --git a/tests/client/disco/containers/TestDiscoPane.js b/tests/unit/disco/containers/TestDiscoPane.js similarity index 98% rename from tests/client/disco/containers/TestDiscoPane.js rename to tests/unit/disco/containers/TestDiscoPane.js index 03606dcbe6..530c3d6504 100644 --- a/tests/client/disco/containers/TestDiscoPane.js +++ b/tests/unit/disco/containers/TestDiscoPane.js @@ -18,7 +18,7 @@ import { VIDEO_CATEGORY, } from 'disco/constants'; import * as helpers from 'disco/containers/DiscoPane'; -import { getFakeI18nInst, MockedSubComponent } from 'tests/client/helpers'; +import { getFakeI18nInst, MockedSubComponent } from 'tests/unit/helpers'; // Use DiscoPane that isn't wrapped in asyncConnect. diff --git a/tests/client/disco/reducers/testDiscoResults.js b/tests/unit/disco/reducers/testDiscoResults.js similarity index 100% rename from tests/client/disco/reducers/testDiscoResults.js rename to tests/unit/disco/reducers/testDiscoResults.js diff --git a/tests/client/disco/test_api.js b/tests/unit/disco/test_api.js similarity index 100% rename from tests/client/disco/test_api.js rename to tests/unit/disco/test_api.js diff --git a/tests/client/disco/test_tracking.js b/tests/unit/disco/test_tracking.js similarity index 100% rename from tests/client/disco/test_tracking.js rename to tests/unit/disco/test_tracking.js diff --git a/tests/client/helpers.js b/tests/unit/helpers.js similarity index 100% rename from tests/client/helpers.js rename to tests/unit/helpers.js diff --git a/tests/client/ui/TestSearchInput.js b/tests/unit/ui/TestSearchInput.js similarity index 98% rename from tests/client/ui/TestSearchInput.js rename to tests/unit/ui/TestSearchInput.js index 63977a418f..bcb0e73c8e 100644 --- a/tests/client/ui/TestSearchInput.js +++ b/tests/unit/ui/TestSearchInput.js @@ -2,7 +2,7 @@ import React from 'react'; import { renderIntoDocument, Simulate } from 'react-addons-test-utils'; -import { assertHasClass, assertNotHasClass } from 'tests/client/helpers'; +import { assertHasClass, assertNotHasClass } from 'tests/unit/helpers'; import SearchInput from 'ui/components/SearchInput'; describe('', () => { diff --git a/tests/client/ui/components/TestButton.js b/tests/unit/ui/components/TestButton.js similarity index 94% rename from tests/client/ui/components/TestButton.js rename to tests/unit/ui/components/TestButton.js index ecca6e2677..313df68fb8 100644 --- a/tests/client/ui/components/TestButton.js +++ b/tests/unit/ui/components/TestButton.js @@ -1,7 +1,7 @@ import React from 'react'; import Link from 'amo/components/Link'; -import { shallowRender } from 'tests/client/helpers'; +import { shallowRender } from 'tests/unit/helpers'; import Button from 'ui/components/Button'; describe('