@@ -60,18 +60,24 @@ describe('Pipeline dashboard', () => {
6060 expect ( w . filter . close_date . $lte ) . toBe ( '{current_year_end}' ) ;
6161 } ) ;
6262
63- it ( 'uses a sliding `{ offset } ` compareTo on the trend chart' , ( ) => {
63+ it ( 'uses a YoY `previousYear ` compareTo on the trend chart' , ( ) => {
6464 const w : any = byId . get ( 'pipeline_trend_90d' ) ;
65- expect ( w . compareTo ) . toEqual ( { offset : '90d' } ) ;
65+ expect ( w . compareTo ) . toBe ( 'previousYear' ) ;
6666 expect ( w . type ) . toBe ( 'line' ) ;
67+ expect ( w . categoryGranularity ) . toBe ( 'month' ) ;
6768 } ) ;
6869
69- it ( 'omits compareTo on widgets that do not need it (pie, plain bar, total)' , ( ) => {
70+ it ( 'omits compareTo on widgets that do not need it (pie, total)' , ( ) => {
7071 expect ( ( byId . get ( 'total_pipeline' ) as any ) . compareTo ) . toBeUndefined ( ) ;
71- expect ( ( byId . get ( 'opportunities_by_stage' ) as any ) . compareTo ) . toBeUndefined ( ) ;
7272 expect ( ( byId . get ( 'pipeline_by_industry' ) as any ) . compareTo ) . toBeUndefined ( ) ;
7373 } ) ;
7474
75+ it ( 'uses `compareTo: previousPeriod` on the Opportunities by Stage bar chart' , ( ) => {
76+ const w : any = byId . get ( 'opportunities_by_stage' ) ;
77+ expect ( w . compareTo ) . toBe ( 'previousPeriod' ) ;
78+ expect ( w . type ) . toBe ( 'bar' ) ;
79+ } ) ;
80+
7581 it ( 'widgets bind to the opportunity object' , ( ) => {
7682 for ( const w of PipelineDashboard . widgets ) {
7783 expect ( ( w as any ) . object ) . toBe ( 'crm_opportunity' ) ;
0 commit comments