Skip to content

Commit 604f347

Browse files
authored
Disable GitHub export if not running all (category) tests (#1641)
1 parent 51c1b19 commit 604f347

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

app.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ app.all("/tests/*", (req: Request, res: Response) => {
472472
if (foundTests && foundTests.length) {
473473
res.render("tests", {
474474
title: `${ident || "All Tests"}`,
475+
ident,
475476
tests: foundTests,
476477
resources: tests.resources,
477478
selenium: req.query.selenium,

views/tests.ejs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ See the LICENSE file for copyright details
1414
<p id="status">Ready to start tests</p>
1515
<form id="export" action="/export" method="post">
1616
<button id="export-download" class="export-button" type="submit" name="download" value="download" disabled><span class="mdi mdi-download"></span> Download results file</button>
17-
<button id="export-github" class="export-button <% if (!github) {%>always-disabled<% } %>" type="submit" name="github" value="github" disabled><span class="mdi mdi-github"></span> <% if (github) {%>Send results to mdn-bcd-results GitHub repo<% } else { %>GitHub export disabled<% } %></button>
17+
<% const githubDisabled = !github || ident.includes('.'); %>
18+
<button id="export-github" class="export-button <% if (githubDisabled) {%>always-disabled<% } %>" type="submit" name="github" value="github" disabled><span class="mdi mdi-github"></span> <% if (!githubDisabled) {%>Send results to mdn-bcd-results GitHub repo<% } else { %>GitHub export disabled<% } %></button>
1819
</form>
1920
<div id="results">
2021
<hr />

0 commit comments

Comments
 (0)