review try-out: show why the open-PR button is disabled
The form's one hint put the PR number first, so with the PR field empty (which opening a PR doesn't need) it hid the repo or row problem that was actually disabling the open-PR button. runProblem now checks the rows first and the PR number last, and is tested. Refs #5259
This commit is contained in:
parent
c90bd705a7
commit
be2e64fa89
3 changed files with 28 additions and 3 deletions
|
|
@ -12,6 +12,7 @@ import {
|
|||
prNumber,
|
||||
repoProblem,
|
||||
rowsProblem,
|
||||
runProblem,
|
||||
thresholdValue,
|
||||
toBody,
|
||||
} from "../src/pages/review-tryout/TryOutTypes.ts";
|
||||
|
|
@ -130,3 +131,13 @@ test("only a typed name or description counts as the user's work", () => {
|
|||
assert.equal(hasTypedText([row({ name: " ", description: "" })]), false);
|
||||
assert.equal(hasTypedText([row({ name: "", description: "x" })]), true);
|
||||
});
|
||||
|
||||
test("the page's one hint names what disables opening a PR before the PR number", () => {
|
||||
// No PR number and a bad row: the row is what disables both buttons.
|
||||
assert.match(runProblem("o/r", "", [row({ name: "" })]), /a name/);
|
||||
assert.match(runProblem("o", "", [row()]), /owner\/name/);
|
||||
// Rows ready but no PR number: only the run is held back.
|
||||
assert.match(runProblem("o/r", "", [row()]), /PR number/);
|
||||
assert.equal(rowsProblem("o/r", [row()]), null);
|
||||
assert.equal(runProblem("o/r", "7", [row()]), null);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue