This commit is contained in:
Cameron Dawson 2019-07-05 09:48:22 -07:00 коммит произвёл GitHub
Родитель fe5e808729
Коммит 5993dea2dc
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
12 изменённых файлов: 47 добавлений и 39 удалений

Просмотреть файл

@ -123,7 +123,7 @@ module.exports = {
}),
process.env.NODE_ENV === 'test' &&
require('@neutrinojs/jest')({
setupFilesAfterEnv: ['<rootDir>/tests/ui/unit/test-setup.js'],
setupFilesAfterEnv: ['<rootDir>/tests/ui/test-setup.js'],
// For more info, see: https://bugzilla.mozilla.org/show_bug.cgi?id=1523376#c3
moduleNameMapper: {
// Hawk's browser and Node APIs differ, and taskcluster-client-web uses APIs that

Просмотреть файл

@ -1,5 +1,5 @@
import { displayNumber } from '../../../ui/perfherder/helpers';
import { getRevisionUrl } from '../../../ui/helpers/url';
import { displayNumber } from '../../ui/perfherder/helpers';
import { getRevisionUrl } from '../../ui/helpers/url';
describe('getRevisionUrl helper', () => {
test('escapes some html symbols', () => {

Просмотреть файл

@ -1,10 +1,10 @@
import React from 'react';
import { mount } from 'enzyme';
import { mount } from 'enzyme/build';
import { fetchMock } from 'fetch-mock';
import { hgBaseUrl, bzBaseUrl } from '../../../../ui/helpers/url';
import { isReftest } from '../../../../ui/helpers/job';
import { BugFilerClass } from '../../../../ui/job-view/details/BugFiler';
import { hgBaseUrl, bzBaseUrl } from '../../../ui/helpers/url';
import { isReftest } from '../../../ui/helpers/job';
import { BugFilerClass } from '../../../ui/job-view/details/BugFiler';
describe('BugFiler', () => {
const fullLog =

Просмотреть файл

@ -1,6 +1,6 @@
import React from 'react';
import { fetchMock } from 'fetch-mock';
import { mount } from 'enzyme';
import { mount } from 'enzyme/build';
import { getProjectUrl } from '../../../../ui/helpers/location';
import { PushesClass } from '../../../../ui/job-view/context/Pushes';
@ -44,7 +44,11 @@ describe('Pushes context', () => {
*/
test('should have 2 pushes', async () => {
const pushes = mount(
<PushesClass filterModel={new FilterModel()} notify={() => {}}>
<PushesClass
filterModel={new FilterModel()}
notify={() => {}}
setSelectedJob={() => {}}
>
<div />
</PushesClass>,
);
@ -54,7 +58,11 @@ describe('Pushes context', () => {
test('should have id of 1 in current repo', async () => {
const pushes = mount(
<PushesClass filterModel={new FilterModel()} notify={() => {}}>
<PushesClass
filterModel={new FilterModel()}
notify={() => {}}
setSelectedJob={() => {}}
>
<div />
</PushesClass>,
);

Просмотреть файл

@ -1,12 +1,12 @@
/* eslint-disable jest/prefer-to-have-length */
import React from 'react';
import cloneDeep from 'lodash/cloneDeep';
import { mount } from 'enzyme';
import { mount } from 'enzyme/build';
import { JobGroupComponent } from '../../../../ui/job-view/pushes/JobGroup';
import FilterModel from '../../../../ui/models/filter';
import mappedGroupFixture from '../../mock/mappedGroup';
import mappedGroupDupsFixture from '../../mock/mappedGroupDups';
import { JobGroupComponent } from '../../../ui/job-view/pushes/JobGroup';
import FilterModel from '../../../ui/models/filter';
import mappedGroupFixture from '../mock/mappedGroup';
import mappedGroupDupsFixture from '../mock/mappedGroupDups';
describe('JobGroup component', () => {
let countGroup;

Просмотреть файл

@ -1,12 +1,12 @@
import React from 'react';
import { mount } from 'enzyme';
import { mount } from 'enzyme/build';
import RepositoryModel from '../../../../ui/models/repository';
import { Revision, Initials } from '../../../../ui/job-view/pushes/Revision';
import RepositoryModel from '../../../ui/models/repository';
import { Revision, Initials } from '../../../ui/job-view/pushes/Revision';
import {
RevisionList,
MoreRevisionsLink,
} from '../../../../ui/job-view/pushes/RevisionList';
} from '../../../ui/job-view/pushes/RevisionList';
describe('Revision list component', () => {
let mockData;

Просмотреть файл

@ -7,12 +7,12 @@ import {
waitForElement,
} from '@testing-library/react';
import PushJobs from '../../../../ui/job-view/pushes/PushJobs';
import FilterModel from '../../../../ui/models/filter';
import { store } from '../../../../ui/job-view/redux/store';
import { PinnedJobs } from '../../../../ui/job-view/context/PinnedJobs';
import { getUrlParam, setUrlParam } from '../../../../ui/helpers/location';
import JobModel from '../../../../ui/models/job';
import PushJobs from '../../../ui/job-view/pushes/PushJobs';
import FilterModel from '../../../ui/models/filter';
import { store } from '../../../ui/job-view/redux/store';
import { PinnedJobs } from '../../../ui/job-view/context/PinnedJobs';
import { getUrlParam, setUrlParam } from '../../../ui/helpers/location';
import JobModel from '../../../ui/models/job';
const testPush = {
id: 494796,

Просмотреть файл

@ -1,10 +1,10 @@
import { fetchMock } from 'fetch-mock';
import JobModel from '../../../../ui/models/job';
import { getProjectUrl } from '../../../../ui/helpers/location';
import jobListFixtureOne from '../../mock/job_list/job_1';
import paginatedJobListFixtureOne from '../../mock/job_list/pagination/page_1';
import paginatedJobListFixtureTwo from '../../mock/job_list/pagination/page_2';
import JobModel from '../../../ui/models/job';
import { getProjectUrl } from '../../../ui/helpers/location';
import jobListFixtureOne from '../mock/job_list/job_1';
import paginatedJobListFixtureOne from '../mock/job_list/pagination/page_1';
import paginatedJobListFixtureTwo from '../mock/job_list/pagination/page_2';
describe('JobModel', () => {
afterEach(() => {

Просмотреть файл

@ -8,9 +8,9 @@ import {
wait,
} from '@testing-library/react';
import AlertsViewControls from '../../../../ui/perfherder/alerts/AlertsViewControls';
import optionCollectionMap from '../../mock/optionCollectionMap';
import { summaryStatusMap } from '../../../../ui/perfherder/constants';
import AlertsViewControls from '../../../ui/perfherder/alerts/AlertsViewControls';
import optionCollectionMap from '../mock/optionCollectionMap';
import { summaryStatusMap } from '../../../ui/perfherder/constants';
const testUser = {
username: 'test user',

Просмотреть файл

@ -7,8 +7,8 @@ import {
waitForElementToBeRemoved,
} from '@testing-library/react';
import CompareTableControls from '../../../../ui/perfherder/compare/CompareTableControls';
import { filterText } from '../../../../ui/perfherder/constants';
import CompareTableControls from '../../../ui/perfherder/compare/CompareTableControls';
import { filterText } from '../../../ui/perfherder/constants';
// TODO addtional tests:
// 1) that the table is receiving the correct data structure after data

Просмотреть файл

@ -1,8 +1,8 @@
import React from 'react';
import { render, cleanup, waitForElement } from '@testing-library/react';
import ReplicatesGraph from '../../../../ui/perfherder/compare/ReplicatesGraph';
import { noDataFoundMessage } from '../../../../ui/perfherder/constants';
import ReplicatesGraph from '../../../ui/perfherder/compare/ReplicatesGraph';
import { noDataFoundMessage } from '../../../ui/perfherder/constants';
// TODO addtional tests:
const TEST_SUITE_NAME = 'testSuiteName';

Просмотреть файл

@ -1,6 +1,6 @@
// Entry point for Jest tests
import { configure } from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
import { configure } from 'enzyme/build';
import Adapter from 'enzyme-adapter-react-16/build';
import 'jest-dom/extend-expect';
configure({ adapter: new Adapter() });