Skip to content

Commit

Permalink
Add origin trials to shipping stages check for oudated warnings (#4514)
Browse files Browse the repository at this point in the history
* Add origin trials to shipping stages check for oudated warnings

* Add all OT stages
  • Loading branch information
KyleJu authored Nov 1, 2024
1 parent 4dfd86d commit 06ee8b6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
13 changes: 10 additions & 3 deletions client-src/elements/chromedash-feature-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ import './chromedash-feature-highlights.js';
import {GateDict} from './chromedash-gate-chip.js';
import {Process, ProgressItem} from './chromedash-gate-column.js';
import {showToastMessage, isVerifiedWithinGracePeriod} from './utils.js';
import {STAGE_TYPES_SHIPPING} from './form-field-enums';
import {
STAGE_TYPES_SHIPPING,
STAGE_TYPES_ORIGIN_TRIAL,
} from './form-field-enums';

const INACTIVE_STATES = ['No longer pursuing', 'Deprecated', 'Removed'];
declare var ga: Function;
Expand Down Expand Up @@ -159,9 +162,13 @@ export class ChromedashFeaturePage extends LitElement {
}

const shippingMilestones = new Set<number | undefined>();
// Get milestones from all shipping stages, STAGE_TYPES_SHIPPING.
const neededStageTypes = new Set<number>([
...STAGE_TYPES_SHIPPING,
...STAGE_TYPES_ORIGIN_TRIAL,
]);
// Get milestones from all shipping stages.
for (const stage of stages) {
if (STAGE_TYPES_SHIPPING.has(stage.stage_type)) {
if (neededStageTypes.has(stage.stage_type)) {
shippingMilestones.add(stage.desktop_first);
shippingMilestones.add(stage.android_first);
shippingMilestones.add(stage.ios_first);
Expand Down
10 changes: 10 additions & 0 deletions client-src/elements/chromedash-feature-page_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,16 @@ describe('chromedash-feature-page', () => {
assert.isTrue(component.isUpcoming);
assert.isFalse(component.hasShipped);
assert.equal(component.closestShippingDate, '2020-03-13T00:00:00');

component.closestShippingDate = '';
component.isUpcoming = false;
stages = structuredClone(feature.stages);
// Test with STAGE_BLINK_ORIGIN_TRIAL type.
stages[2].stage_type = 150;
component.findClosestShippingDate(channels, stages);
assert.isTrue(component.isUpcoming);
assert.isFalse(component.hasShipped);
assert.equal(component.closestShippingDate, '2020-03-13T00:00:00');
});

it('findClosestShippingDate() tests for hasShipped state', async () => {
Expand Down

0 comments on commit 06ee8b6

Please sign in to comment.