generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: extend tests for
issue-form.ts
and labeler.ts
- Loading branch information
Showing
5 changed files
with
215 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
// Vitest Snapshot v1 | ||
|
||
exports[`IssueForm Object > getProperty() 1`] = `undefined`; | ||
|
||
exports[`IssueForm Object > getProperty() 2`] = `"Security guidelines provided by GitHub: [Security hardening for GitHub Actions ](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#overview)"`; | ||
|
||
exports[`IssueForm Object > getProperty() 3`] = `undefined`; | ||
|
||
exports[`IssueForm Object > getSafeProperty() 1`] = `undefined`; | ||
|
||
exports[`IssueForm Object > getSafeProperty() 2`] = `"Security guidelines provided by GitHub: [Security hardening for GitHub Actions ](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#overview)"`; | ||
|
||
exports[`IssueForm Object > getSafeProperty() 3`] = `undefined`; | ||
|
||
exports[`IssueForm Object > isProperty() 1`] = `false`; | ||
|
||
exports[`IssueForm Object > isProperty() 2`] = `true`; | ||
|
||
exports[`IssueForm Object > isProperty() 3`] = `false`; | ||
|
||
exports[`IssueForm Object > listKeywords() 1`] = `undefined`; | ||
|
||
exports[`IssueForm Object > listKeywords() 2`] = `undefined`; | ||
|
||
exports[`IssueForm Object > listKeywords() 3`] = `undefined`; | ||
|
||
exports[`IssueForm Object > listKeywords() 4`] = `undefined`; | ||
|
||
exports[`IssueForm Object > listKeywords() 5`] = `undefined`; | ||
|
||
exports[`IssueForm Object > listKeywords() 6`] = `undefined`; | ||
|
||
exports[`IssueForm Object > listKeywords() 7`] = ` | ||
[ | ||
"Feature Request", | ||
"none", | ||
"other", | ||
] | ||
`; | ||
|
||
exports[`IssueForm Object > listKeywords() 8`] = `undefined`; | ||
|
||
exports[`IssueForm Object > listKeywords() 9`] = ` | ||
[ | ||
"Feature Request", | ||
"none", | ||
] | ||
`; | ||
|
||
exports[`IssueForm Object > listKeywords() 10`] = `undefined`; | ||
|
||
exports[`IssueForm Object > listKeywords() 11`] = ` | ||
[ | ||
"Feature Request", | ||
] | ||
`; | ||
|
||
exports[`IssueForm Object > listKeywords() 12`] = `undefined`; | ||
|
||
exports[`IssueForm Object > listKeywords() 13`] = `undefined`; | ||
|
||
exports[`IssueForm Object > listKeywords() 14`] = ` | ||
[ | ||
"bootctl", | ||
"systemd-boot", | ||
"other", | ||
] | ||
`; | ||
|
||
exports[`IssueForm Object > listKeywords() 15`] = `undefined`; | ||
|
||
exports[`IssueForm Object > listKeywords() 16`] = ` | ||
[ | ||
"bootctl", | ||
"systemd-boot", | ||
] | ||
`; | ||
|
||
exports[`IssueForm Object > listKeywords() 17`] = `undefined`; | ||
|
||
exports[`IssueForm Object > listKeywords() 18`] = ` | ||
[ | ||
"bootctl", | ||
"systemd-boot", | ||
] | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { IssueForm } from '../../../src/issue-form'; | ||
|
||
export interface IIssueFormTestContext { | ||
issueForms: IssueForm[]; | ||
blockLists: string[][]; | ||
invalid: IssueForm[]; | ||
} | ||
|
||
export const issueFormContextFixture: IIssueFormTestContext = { | ||
issueForms: [ | ||
new IssueForm({}), | ||
// issue: https://github.com/redhat-plumbers-in-action/advanced-issue-labeler/issues/171 | ||
new IssueForm({ | ||
type: 'Feature Request, none, other', | ||
description: | ||
'Security guidelines provided by GitHub: [Security hardening for GitHub Actions ](https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#overview)', | ||
solution: | ||
"Let's review the document from GitHub regarding GitHub Actions and security. And make Advanced Issue Labeler more secure!\n\nSecurity is a long-term goal, not one of, so it would be great to have some ci check or checkbox in the Pull Request template to ensure that when reviewing new code, we comply with best security policies and guidelines.", | ||
}), | ||
// issue: https://github.com/systemd/systemd/issues/25737 | ||
new IssueForm({ | ||
version: '252.3-1', | ||
distro: 'Arch Linux', | ||
kernel: '6.0.12-arch1-1 and 5.15.82-1-lts', | ||
architecture: 'x86_64', | ||
component: 'bootctl, systemd-boot, other', | ||
'expected-behaviour': 'System booting correctly with systemd-boot.', | ||
'unexpected-behaviour': | ||
'System hangs immediately after choosing the boot-entry, just showing a black screen with the following message in top left corner in red letters:\n\nFailed to open random seed file: Media changed\r\nError opening root path: Invalid Parameter', | ||
'steps-to-reproduce': | ||
"- Coming from systemd 251.7-4 (which worked flawlessly) and updating to 252.3-1.\r\n- Running 'bootctl update'\r\n- Reboot\n\nUpdating to 252.3-1 WITHOUT running 'bootctl update' afterwards works fine. The system boots without any problems.\n\nSo the problem seems really systemd-boot related. Maybe something in 'systemd-bootx64.efi\" have changed and my Lenovo E15 Gen 2 doesn't like that.", | ||
'additional-information': '', | ||
}), | ||
], | ||
|
||
blockLists: [[], ['other'], ['block1', 'block2', 'other', 'none']], | ||
|
||
invalid: [ | ||
// @ts-expect-error: Let's ignore a type error, it's required for testing | ||
new IssueForm(), | ||
// @ts-expect-error: Let's ignore a type error, it's required for testing | ||
new IssueForm(undefined), | ||
// @ts-expect-error: Let's ignore a type error, it's required for testing | ||
new IssueForm(null), | ||
new IssueForm('form'), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters