{"size": 1159, "ext": "js", "max_stars_repo_path": "symphony/app/fbcnms-projects/inventory/app/components/__tests__/Admin-test.js", "max_stars_repo_name": "idoshveki/magma", "max_stars_repo_stars_event_min_datetime": "2020-11-05T18:58:26.000Z", "max_stars_repo_stars_event_max_datetime": "2021-02-09T06:42:49.000Z", "max_issues_repo_path": "symphony/app/fbcnms-projects/inventory/app/components/__tests__/Admin-test.js", "max_issues_repo_name": "idoshveki/magma", "max_issues_repo_issues_event_min_datetime": "2021-03-31T20:19:00.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-19T07:09:57.000Z", "max_forks_repo_path": "symphony/app/fbcnms-projects/inventory/app/components/__tests__/Admin-test.js", "max_forks_repo_name": "idoshveki/magma", "max_forks_repo_forks_event_min_datetime": "2020-08-20T18:45:34.000Z", "max_forks_repo_forks_event_max_datetime": "2020-08-20T20:18:42.000Z"}
{"max_stars_count": 2, "max_issues_count": 10, "max_forks_count": 3, "avg_line_length": 22.7254901961, "max_line_length": 72, "alphanum_fraction": 0.6609145815}
/**
 * Copyright 2004-present Facebook. All Rights Reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow strict-local
 * @format
 */

import 'jest-dom/extend-expect';
import Admin from '../admin/Admin';
import React from 'react';
import {MemoryRouter} from 'react-router-dom';
import {Route} from 'react-router-dom';
import {cleanup, render} from '@testing-library/react';

jest.mock(
  '@fbcnms/magmalte/app/components/admin/AdminContextProvider',
  () => props => <div>{props.children}</div>,
);

const Wrapper = props => (
  <MemoryRouter initialEntries={[props.path]} initialIndex={1}>
    <Route path="/admin">{props.children}</Route>
  </MemoryRouter>
);

afterEach(cleanup);

global.CONFIG = {
  appData: {
    enabledFeatures: [],
    tabs: ['admin'],
    user: {
      isSuperUser: false,
    },
  },
  MAPBOX_ACCESS_TOKEN: '',
};

test('renders /settings', () => {
  const {getByTestId} = render(
    <Wrapper path={'/admin/settings'}>
      <Admin />
    </Wrapper>,
  );

  expect(getByTestId('change-password-title')).toBeInTheDocument();
});
