@@ -19,7 +19,6 @@ import {
1919 groupPullRequestsByInvolvement ,
2020 matchesPullRequestFilters ,
2121 matchesPullRequestQuery ,
22- parsePullRequestQuery ,
2322 pullRequestStatsBatches ,
2423 pullRequestStatsKeysToRequest ,
2524 pullRequestStatsRefreshBatches ,
@@ -557,84 +556,6 @@ describe("narrowing rows by the filters a host may not have applied", () => {
557556 } ) ;
558557} ) ;
559558
560- describe ( "reading qualifiers out of a typed query" , ( ) => {
561- it ( "keeps quoted values whole and separates negation" , ( ) => {
562- expect ( parsePullRequestQuery ( 'label:"needs design" -label:wip Fix the parser' ) ) . toEqual ( {
563- text : "Fix the parser" ,
564- filters : { labels : [ [ "needs design" ] ] , excludedLabels : [ "wip" ] } ,
565- } ) ;
566- } ) ;
567-
568- it ( "reads a comma-separated list as one group either name satisfies" , ( ) => {
569- expect ( parsePullRequestQuery ( "label:size:S,size:XS" ) . filters . labels ) . toEqual ( [
570- [ "size:S" , "size:XS" ] ,
571- ] ) ;
572- } ) ;
573-
574- it ( "keeps the spaces in a quoted name of a list, and drops an empty part" , ( ) => {
575- expect ( parsePullRequestQuery ( 'label:"needs design","wip"' ) . filters . labels ) . toEqual ( [
576- [ "needs design" , "wip" ] ,
577- ] ) ;
578- expect ( parsePullRequestQuery ( "label:a,,b" ) . filters . labels ) . toEqual ( [ [ "a" , "b" ] ] ) ;
579- } ) ;
580-
581- it ( "excludes every name of a negated list" , ( ) => {
582- expect ( parsePullRequestQuery ( "-label:a,b" ) . filters ) . toEqual ( { excludedLabels : [ "a" , "b" ] } ) ;
583- } ) ;
584-
585- it ( "makes each label qualifier its own group, so the groups are an AND" , ( ) => {
586- expect ( parsePullRequestQuery ( "label:bug label:a,b" ) . filters . labels ) . toEqual ( [
587- [ "bug" ] ,
588- [ "a" , "b" ] ,
589- ] ) ;
590- } ) ;
591-
592- it ( "reads the scalar qualifiers in GitHub's own spelling" , ( ) => {
593- expect (
594- parsePullRequestQuery ( "author:octocat DRAFT:false review:changes_requested status:failure" )
595- . filters ,
596- ) . toEqual ( {
597- author : "octocat" ,
598- draft : "hide" ,
599- review : "changes-requested" ,
600- checks : "failing" ,
601- } ) ;
602- } ) ;
603-
604- it ( "leaves an unknown value and a stray colon as text, and reads an unknown key as a label" , ( ) => {
605- const parsed = parsePullRequestQuery ( "milestone:v2 draft:maybe status: parser" ) ;
606- expect ( parsed . filters ) . toEqual ( { labels : [ [ "milestone:v2" ] ] } ) ;
607- expect ( parsed . text ) . toBe ( "draft:maybe status: parser" ) ;
608- } ) ;
609-
610- it ( "reads a quoted name holding a comma as the one label it is" , ( ) => {
611- expect ( parsePullRequestQuery ( 'label:"needs,triage"' ) . filters . labels ) . toEqual ( [
612- [ "needs,triage" ] ,
613- ] ) ;
614- expect ( parsePullRequestQuery ( '-label:"needs,triage"' ) . filters . excludedLabels ) . toEqual ( [
615- "needs,triage" ,
616- ] ) ;
617- } ) ;
618-
619- it ( "cuts a typed query back to what the contract carries" , ( ) => {
620- const many = Array . from ( { length : 14 } , ( _ , index ) => `l${ index } ` ) . join ( "," ) ;
621- const long = "x" . repeat ( 240 ) ;
622- const parsed = parsePullRequestQuery ( `label:${ many } label:${ long } author:${ long } ` ) ;
623- expect ( parsed . filters . labels ?. [ 0 ] ) . toHaveLength ( 10 ) ;
624- expect ( parsed . filters . labels ?. [ 1 ] ) . toEqual ( [ "x" . repeat ( 200 ) ] ) ;
625- expect ( parsed . filters . author ) . toBe ( "x" . repeat ( 200 ) ) ;
626- } ) ;
627-
628- it ( "cuts a namespaced label after its key is prefixed on" , ( ) => {
629- const parsed = parsePullRequestQuery ( `size:${ "x" . repeat ( 240 ) } ` ) ;
630- expect ( parsed . filters . labels ) . toEqual ( [ [ `size:${ "x" . repeat ( 240 ) } ` . slice ( 0 , 200 ) ] ] ) ;
631- } ) ;
632-
633- it ( "answers an empty query with an empty everything" , ( ) => {
634- expect ( parsePullRequestQuery ( " " ) ) . toEqual ( { text : "" , filters : { } } ) ;
635- } ) ;
636- } ) ;
637-
638559describe ( "resolveProjectScope" , ( ) => {
639560 const projects = [ { id : "p1" } , { id : "p2" } ] ;
640561
@@ -1508,58 +1429,6 @@ describe("the server a saved selection names", () => {
15081429 } ) ;
15091430} ) ;
15101431
1511- describe ( "colon-namespaced labels typed as a search" , ( ) => {
1512- it ( "reads an unknown key as the label it almost always is" , ( ) => {
1513- expect ( parsePullRequestQuery ( "size:XXL" ) . filters . labels ) . toEqual ( [ [ "size:XXL" ] ] ) ;
1514- expect ( parsePullRequestQuery ( "vouch:trusted" ) . filters . labels ) . toEqual ( [ [ "vouch:trusted" ] ] ) ;
1515- expect ( parsePullRequestQuery ( "size:XXL" ) . text ) . toBe ( "" ) ;
1516- } ) ;
1517-
1518- it ( "reads the key as the namespace of every bare name in its list" , ( ) => {
1519- expect ( parsePullRequestQuery ( "size:S,XS" ) . filters . labels ) . toEqual ( [ [ "size:S" , "size:XS" ] ] ) ;
1520- } ) ;
1521-
1522- it ( "leaves a name that already carries its own namespace alone" , ( ) => {
1523- expect ( parsePullRequestQuery ( "size:S,size:XS" ) . filters . labels ) . toEqual ( [ [ "size:S" , "size:XS" ] ] ) ;
1524- } ) ;
1525-
1526- it ( "excludes one the same way" , ( ) => {
1527- expect ( parsePullRequestQuery ( "-size:XXL" ) . filters . excludedLabels ) . toEqual ( [ "size:XXL" ] ) ;
1528- expect ( parsePullRequestQuery ( "-size:S,XS" ) . filters . excludedLabels ) . toEqual ( [
1529- "size:S" ,
1530- "size:XS" ,
1531- ] ) ;
1532- } ) ;
1533-
1534- it ( "keeps a quoted token as text, which is the way back to a literal search" , ( ) => {
1535- const parsed = parsePullRequestQuery ( '"size:XXL"' ) ;
1536- expect ( parsed . filters . labels ) . toBeUndefined ( ) ;
1537- expect ( parsed . text ) . toBe ( '"size:XXL"' ) ;
1538- } ) ;
1539-
1540- it ( "reads a hyphenated namespace as a label too" , ( ) => {
1541- expect ( parsePullRequestQuery ( "priority-1:high" ) . filters . labels ) . toEqual ( [ [ "priority-1:high" ] ] ) ;
1542- expect ( parsePullRequestQuery ( "priority-1:high" ) . text ) . toBe ( "" ) ;
1543- } ) ;
1544-
1545- it ( "leaves a pasted link alone rather than naming a label after its scheme" , ( ) => {
1546- const parsed = parsePullRequestQuery ( "https://github.com/pingdotgg/t3code/pull/1" ) ;
1547- expect ( parsed . filters . labels ) . toBeUndefined ( ) ;
1548- expect ( parsed . text ) . toBe ( "https://github.com/pingdotgg/t3code/pull/1" ) ;
1549- } ) ;
1550-
1551- it ( "mixes with the keys it does know, and with plain words" , ( ) => {
1552- const parsed = parsePullRequestQuery ( "area:web draft:true wizard label:bug" ) ;
1553- expect ( parsed . filters ) . toEqual ( { labels : [ [ "area:web" ] , [ "bug" ] ] , draft : "only" } ) ;
1554- expect ( parsed . text ) . toBe ( "wizard" ) ;
1555- } ) ;
1556-
1557- it ( "shares the ceiling with the labels typed as labels" , ( ) => {
1558- const many = Array . from ( { length : 12 } , ( _ , index ) => `area:${ index } ` ) . join ( " " ) ;
1559- expect ( parsePullRequestQuery ( many ) . filters . labels ) . toHaveLength ( 10 ) ;
1560- } ) ;
1561- } ) ;
1562-
15631432describe ( "the priority groups against a paginated feed" , ( ) => {
15641433 const authoredRow = ( number : number , updatedAt : string ) =>
15651434 entry ( { number, updatedAt, author : { login : "Bilal" , name : null , avatarUrl : null } } ) ;
0 commit comments