@@ -6,16 +6,6 @@ import { getWidth } from '@js/core/utils/size';
66
77import fx from '../../../common/core/animation/fx' ;
88import CustomStore from '../../../data/custom_store' ;
9- import { getResourceManagerMock } from '../__mock__/resource_manager.mock' ;
10- import SchedulerTimelineDay from '../workspaces/m_timeline_day' ;
11- import SchedulerTimelineMonth from '../workspaces/m_timeline_month' ;
12- import SchedulerTimelineWeek from '../workspaces/m_timeline_week' ;
13- import SchedulerTimelineWorkWeek from '../workspaces/m_timeline_work_week' ;
14- import type SchedulerWorkSpace from '../workspaces/m_work_space' ;
15- import SchedulerWorkSpaceDay from '../workspaces/m_work_space_day' ;
16- import SchedulerWorkSpaceMonth from '../workspaces/m_work_space_month' ;
17- import SchedulerWorkSpaceWeek from '../workspaces/m_work_space_week' ;
18- import SchedulerWorkSpaceWorkWeek from '../workspaces/m_work_space_work_week' ;
199import { createScheduler } from './__mock__/create_scheduler' ;
2010import { setupSchedulerTestEnvironment } from './__mock__/m_mock_scheduler' ;
2111
@@ -24,67 +14,8 @@ const CLASSES = {
2414 workSpace : 'dx-scheduler-work-space' ,
2515} ;
2616
27- type WorkspaceConstructor < T > = new ( container : Element , options ?: any ) => T ;
28-
29- const createWorkspace = < T extends SchedulerWorkSpace > (
30- WorkSpace : WorkspaceConstructor < T > ,
31- currentView : string ,
32- ) : T => {
33- const container = document . createElement ( 'div' ) ;
34- const workspace = new WorkSpace ( container , {
35- views : [ currentView ] ,
36- currentView,
37- currentDate : new Date ( 2017 , 4 , 25 ) ,
38- firstDayOfWeek : 0 ,
39- getResourceManager : ( ) => getResourceManagerMock ( [ ] ) ,
40- } ) ;
41- ( workspace as any ) . _isVisible = ( ) => true ;
42- expect ( container . classList ) . toContain ( 'dx-scheduler-work-space' ) ;
43-
44- return workspace ;
45- } ;
46-
47- const workSpaces : {
48- currentView : string ;
49- WorkSpace : WorkspaceConstructor < SchedulerWorkSpace > ;
50- } [ ] = [
51- { currentView : 'day' , WorkSpace : SchedulerWorkSpaceDay } ,
52- { currentView : 'week' , WorkSpace : SchedulerWorkSpaceWeek } ,
53- { currentView : 'workWeek' , WorkSpace : SchedulerWorkSpaceWorkWeek } ,
54- { currentView : 'month' , WorkSpace : SchedulerWorkSpaceMonth } ,
55- { currentView : 'timelineDay' , WorkSpace : SchedulerTimelineDay } ,
56- { currentView : 'timelineWeek' , WorkSpace : SchedulerTimelineWeek } ,
57- { currentView : 'timelineWorkWeek' , WorkSpace : SchedulerTimelineWorkWeek } ,
58- { currentView : 'timelineMonth' , WorkSpace : SchedulerTimelineMonth } ,
59- ] ;
60-
6117describe ( 'Workspace' , ( ) => {
62- describe ( 'Base functionality' , ( ) => {
63- workSpaces . forEach ( ( { currentView, WorkSpace } ) => {
64- it ( `should clear cache on dimension change, view: ${ currentView } ` , ( ) => {
65- const workspace = createWorkspace ( WorkSpace , currentView ) ;
66- jest . spyOn ( workspace . cache , 'clear' ) ;
67-
68- workspace . cache . memo ( 'test' , ( ) => 'value' ) ;
69- workspace . _dimensionChanged ( ) ;
70-
71- expect ( workspace . cache . clear ) . toHaveBeenCalledTimes ( 1 ) ;
72- } ) ;
73-
74- it ( `should clear cache on _cleanView call, view: ${ currentView } ` , ( ) => {
75- const workspace = createWorkspace ( WorkSpace , currentView ) ;
76- jest . spyOn ( workspace . cache , 'clear' ) ;
77-
78- workspace . cache . memo ( 'test' , ( ) => 'value' ) ;
79- workspace . _cleanView ( ) ;
80-
81- expect ( workspace . cache . clear ) . toHaveBeenCalledTimes ( 1 ) ;
82- expect ( workspace . cache . size ) . toBe ( 0 ) ;
83- } ) ;
84- } ) ;
85- } ) ;
86-
87- describe ( 'Recalculation with Async Templates' , ( ) => {
18+ describe ( 'Recalculation with Async Templates (T661335)' , ( ) => {
8819 beforeEach ( ( ) => {
8920 fx . off = true ;
9021 setupSchedulerTestEnvironment ( { height : 600 } ) ;
@@ -149,7 +80,7 @@ describe('Workspace', () => {
14980 } ) ;
15081 } ) ;
15182
152- describe ( 'scrollTo' , ( ) => {
83+ describe ( 'scrollTo (T1310544) ' , ( ) => {
15384 beforeEach ( ( ) => {
15485 fx . off = true ;
15586 setupSchedulerTestEnvironment ( { height : 600 } ) ;
@@ -160,7 +91,7 @@ describe('Workspace', () => {
16091 fx . off = false ;
16192 } ) ;
16293
163- it ( 'should scroll to date with offset (T1310544 )' , async ( ) => {
94+ it ( 'T1310544: should scroll to date with offset: 720 (12 hours )' , async ( ) => {
16495 const { scheduler } = await createScheduler ( {
16596 views : [ 'timelineDay' ] ,
16697 currentView : 'timelineDay' ,
0 commit comments