Skip to content

Commit 0142e78

Browse files
committed
Omit the error color for reviews open < 2 weeks.
1 parent 78f50e5 commit 0142e78

File tree

2 files changed

+4
-42
lines changed

2 files changed

+4
-42
lines changed

client-src/elements/chromedash-link.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ function enhanceGithubIssueLink(featureLink, text) {
133133
if (externalReviewer) {
134134
// If this is an issue asking for external review, having it filed too recently is a warning
135135
// sign, which we'll indicate using the tag's color.
136-
if (age < 2 * week) {
137-
stateVariant = 'danger';
138-
} else if (age < 4 * week) {
136+
if (age < 4 * week) {
139137
stateVariant = 'warning';
140138
} else {
141139
// Still only neutral if the reviewer hasn't given a position yet.

client-src/elements/chromedash-link_test.js

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,10 @@ describe('Github issue links', () => {
322322
});
323323
});
324324

325-
it('shows error if open too short', async () => {
325+
it('shows warning if open too short', async () => {
326326
const issue = firefoxIssue();
327327
issue.information.labels = [];
328-
const lastWeek = new Date(Date.now() - 7 * DAY);
328+
const lastWeek = new Date(Date.now() - 3 * 7 * DAY);
329329
issue.information.state = 'open';
330330
issue.information.created_at = lastWeek.toISOString();
331331
const featureLinks = [issue];
@@ -342,7 +342,7 @@ describe('Github issue links', () => {
342342
alt="icon"
343343
class="icon"
344344
src="https://avatars.githubusercontent.com/u/131524?s=48&amp;v=4">
345-
<sl-badge size="small" variant="danger">
345+
<sl-badge size="small" variant="warning">
346346
Opened
347347
<sl-relative-time date="${lastWeek.toISOString()}">
348348
on ${_dateTimeFormat.format(lastWeek)}
@@ -358,42 +358,6 @@ describe('Github issue links', () => {
358358
});
359359
});
360360

361-
it('shows warning if open an intermediate time', async () => {
362-
const issue = firefoxIssue();
363-
issue.information.labels = [];
364-
const threeWeeks = new Date(Date.now() - 3 * 7 * DAY);
365-
issue.information.state = 'open';
366-
issue.information.created_at = threeWeeks.toISOString();
367-
const featureLinks = [issue];
368-
const el = await fixture(html`<chromedash-link
369-
href="https://github.com/mozilla/standards-positions/issues/975"
370-
.featureLinks=${featureLinks}>Content</chromedash-link>`);
371-
expect(el).shadowDom.to.equal(
372-
`<a href="https://github.com/mozilla/standards-positions/issues/975"
373-
rel="noopener noreferrer" target="_blank">
374-
<sl-tooltip>
375-
<div slot="content">...</div>
376-
<sl-tag>
377-
<img
378-
alt="icon"
379-
class="icon"
380-
src="https://avatars.githubusercontent.com/u/131524?s=48&amp;v=4">
381-
<sl-badge size="small" variant="warning">
382-
Opened
383-
<sl-relative-time date="${threeWeeks.toISOString()}">
384-
on ${_dateTimeFormat.format(threeWeeks)}
385-
</sl-relative-time>
386-
</sl-badge>
387-
#975 The textInput event
388-
</sl-tag>
389-
</sl-tooltip>
390-
</a>`,
391-
{
392-
ignoreChildren: ['div'],
393-
ignoreAttributes: ['style', 'title'],
394-
});
395-
});
396-
397361
it('shows neutral if open a long time', async () => {
398362
const issue = firefoxIssue();
399363
issue.information.labels = [];

0 commit comments

Comments
 (0)