feat: generate test issue + new dependencies

Signed-off-by: Kamil Wolny <mrwolny@gmail.com>
This commit is contained in:
Kamil Wolny
2022-08-09 23:27:46 +01:00
parent 46956e6fef
commit a2ee1d73d1
4 changed files with 78 additions and 2 deletions
+3 -1
View File
@@ -25,15 +25,17 @@
"@backstage/catalog-model": "^1.0.3",
"@backstage/core-components": "^0.11.0-next.2",
"@backstage/core-plugin-api": "^1.0.5-next.0",
"@backstage/errors": "^1.1.0",
"@backstage/integration": "^1.3.0-next.0",
"@backstage/plugin-catalog-react": "^1.1.3-next.2",
"@backstage/theme": "^0.2.15",
"@faker-js/faker": "^7.4.0",
"@material-ui/core": "^4.12.4",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.61",
"luxon": "^2.4.0",
"octokit": "^2.0.4",
"react-use": "^17.2.4"
"react-use": "^17.4.0"
},
"peerDependencies": {
"react": "^16.13.1 || ^17.0.0"
@@ -0,0 +1,53 @@
/*
* Copyright 2022 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { faker } from '@faker-js/faker';
import { Issue } from '../api';
export const generateTestIssue = (
overwrites: Partial<Issue> = {},
): { node: Issue } => ({
node: {
...{
assignees: {
edges: [
{
node: {
avatarUrl: faker.internet.avatar(),
login: `${faker.word.adjective()}-${faker.animal.type()}`,
},
},
],
},
author: {
login: `${faker.word.adjective()}-${faker.animal.type()}`,
},
repository: {
nameWithOwner: `${faker.animal.type()}/${faker.animal.type()}`,
},
title: faker.lorem.words(3),
url: faker.internet.url(),
participants: {
totalCount: +faker.random.numeric(),
},
updatedAt: faker.date.past().toISOString(),
createdAt: faker.date.past().toISOString(),
comments: {
totalCount: +faker.random.numeric(),
},
},
...overwrites,
},
});
+16
View File
@@ -0,0 +1,16 @@
/*
* Copyright 2022 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './generateTestIssue';