Merge branch 'main' into avm99963-monorail
Merged commit 3779da353b36d43cf778e7d4f468097714dd4540
GitOrigin-RevId: 6451a5c6b75afb0fd1f37b3f14521148d0722ea8
diff --git a/static_src/reducers/issueV0.test.js b/static_src/reducers/issueV0.test.js
index 33b63c1..b79cdb5 100644
--- a/static_src/reducers/issueV0.test.js
+++ b/static_src/reducers/issueV0.test.js
@@ -12,6 +12,7 @@
import {issueToIssueRef, issueRefToString} from 'shared/convertersV0.js';
import {prpcClient} from 'prpc-client-instance.js';
import {getSigninInstance} from 'shared/gapi-loader.js';
+import {migratedTypes} from 'shared/issue-fields.js';
let prpcCall;
let dispatch;
@@ -323,6 +324,48 @@
{label: 'migrated-to-b-1234'},
{label: 'migrated-to-b-6789'},
]})), '1234');
+
+ assert.equal(issueV0.migratedId(wrapIssue({labelRefs: [
+ {label: 'IgnoreThis'},
+ {label: 'IgnoreThis2'},
+ {label: 'migrated-to-launch-6789'},
+ ]})), '6789');
+
+ assert.equal(issueV0.migratedId(wrapIssue({labelRefs: [
+ {label: 'migrated-to-launch-1234'},
+ ]})), '1234');
+
+ // We assume there's only one migrated-to-* label.
+ assert.equal(issueV0.migratedId(wrapIssue({labelRefs: [
+ {label: 'migrated-to-launch-1234'},
+ {label: 'migrated-to-b-6789'},
+ ]})), '1234');
+ });
+
+ it('migratedType', () => {
+ assert.equal(issueV0.migratedType(wrapIssue()), migratedTypes.NONE);
+ assert.equal(issueV0.migratedType(wrapIssue({labelRefs: []})), migratedTypes.NONE);
+
+ assert.equal(issueV0.migratedType(wrapIssue({labelRefs: [
+ {label: 'IgnoreThis'},
+ {label: 'IgnoreThis2'},
+ ]})), migratedTypes.NONE);
+
+ assert.equal(issueV0.migratedType(wrapIssue({labelRefs: [
+ {label: 'IgnoreThis'},
+ {label: 'IgnoreThis2'},
+ {label: 'migrated-to-b-6789'},
+ ]})), migratedTypes.BUGANIZER_TYPE);
+
+ assert.equal(issueV0.migratedType(wrapIssue({labelRefs: [
+ {label: 'migrated-to-launch-1234'},
+ ]})), migratedTypes.LAUNCH_TYPE);
+
+ // We assume there's only one migrated-to-b-* label.
+ assert.equal(issueV0.migratedType(wrapIssue({labelRefs: [
+ {label: 'migrated-to-launch-1234'},
+ {label: 'migrated-to-b-6789'},
+ ]})), migratedTypes.LAUNCH_TYPE);
});