Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

g1t.sh

Commit

The deploy's smoke check knows sign-up has a person check. With Turnstile on (its site key went live in 3e77c4cd), the site refuses a sign-up form no person solved before identity sees it, so the check that posts a bad sign-up got "We could not tell that a person sent this form." where it expected identity's "Enter a valid email address." and failed Deploy #312 though every unit deployed. It is now "Sign up refuses a bad form" and passes on either refusal (a new `expectOne` in a check), still with no Turnstile answer and no real-looking address, so nothing is written or counted. Checked: the smoke tests (4) and the five checks against https://g1t.sh.

syntaqxcommitted Parent45ad016Browse files
2 files+18−50/2 viewed
+13−5
2020 { name: "Sign up", path: "/register", expect: ["Create your account", "Create account"] },
2121 { name: "Pricing", path: "/pricing", expect: ["Pricing"] },
2222 {
23− name: "Sign up reaches identity",
23+ name: "Sign up refuses a bad form",
2424 path: "/register",
25− // Not an address, so identity answers "Enter a valid email address."
26− // before its sign-up rate limit and before any write.
25+ // Not an address and no Turnstile answer, so nothing is written or
26+ // counted: with Turnstile on, the site refuses it first (no person
27+ // solved the check); with it off, identity answers "Enter a valid
28+ // email address." before its sign-up rate limit.
2729 form: { username: "smoke-test", email: "smoke-test-not-an-address", password: "not-a-real-password" },
2830 status: 422,
29− expect: ["Enter a valid email address."],
31+ expect: [],
32+ expectOne: ["We could not tell that a person sent this form.", "Enter a valid email address."],
3033 },
3134 ];
3235
4952 if (status !== want) return `answered ${status}, expected ${want}`;
5053 const text = pageText(html);
5154 const missing = check.expect.filter((phrase) => !text.includes(phrase));
52− return missing.length ? `missing ${missing.map((m) => JSON.stringify(m)).join(", ")}` : null;
55+ if (missing.length) return `missing ${missing.map((m) => JSON.stringify(m)).join(", ")}`;
56+ // `expectOne`: at least one of these phrases.
57+ if (check.expectOne && !check.expectOne.some((phrase) => text.includes(phrase))) {
58+ return `missing one of ${check.expectOne.map((m) => JSON.stringify(m)).join(", ")}`;
59+ }
60+ return null;
5361 }
5462
5563 async function run(site) {
+5−0
2727 assert.equal(signUp.path, "/register");
2828 assert.ok(!signUp.form.email.includes("@"), "never a real-looking address, so nothing is kept");
2929 assert.equal(signUp.status, 422);
30+ assert.ok(!("cf-turnstile-response" in signUp.form), "never answers the person check");
31+ // Turnstile off: identity refuses the address. On: the site refuses the form first.
3032 assert.equal(verdict(signUp, 422, "<p>Enter a valid email address.</p>"), null);
33+ assert.equal(verdict(signUp, 422, "<p>We could not tell that a person sent this form. Wait for the check above the button to finish, then try again.</p>"), null);
34+ assert.match(verdict(signUp, 422, "<p>Something else</p>"), /missing one of/);
35+ assert.equal(verdict(signUp, 200, "<p>Enter a valid email address.</p>"), "answered 200, expected 422");
3136 });

Comments

Sign in to comment.