backstage

Форк
0
56 строк · 1.7 Кб
1
/*
2
 * Copyright 2020 The Backstage Authors
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *     http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
import { renderWithEffects } from '@backstage/test-utils';
18

19
jest.mock('@backstage/plugin-graphiql', () => ({
20
  ...jest.requireActual('@backstage/plugin-graphiql'),
21
  GraphiQLIcon: () => null,
22
}));
23

24
// Rarely, and only in windows CI, do these tests take slightly more than the
25
// default five seconds
26
jest.setTimeout(15_000);
27

28
describe('App', () => {
29
  it('should render', async () => {
30
    process.env = {
31
      NODE_ENV: 'test',
32
      APP_CONFIG: [
33
        {
34
          data: {
35
            app: {
36
              title: 'Test',
37
              support: { url: 'http://localhost:7007/support' },
38
            },
39
            backend: { baseUrl: 'http://localhost:7007' },
40
            lighthouse: {
41
              baseUrl: 'http://localhost:3003',
42
            },
43
            techdocs: {
44
              storageUrl: 'http://localhost:7007/api/techdocs/static/docs',
45
            },
46
          },
47
          context: 'test',
48
        },
49
      ] as any,
50
    };
51

52
    const { default: app } = await import('./App');
53
    const rendered = await renderWithEffects(app);
54
    expect(rendered.baseElement).toBeInTheDocument();
55
  });
56
});
57

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.