@@ -75,71 +75,4 @@ describe('shouldHandlePlaybookChecklistItemRecord', () => {
7575
7676 expect ( shouldHandlePlaybookChecklistItemRecord ( existingRecord , raw ) ) . toBe ( true ) ;
7777 } ) ;
78-
79- it ( 'should return true when condition_action changes even if update_at is the same' , ( ) => {
80- const existingRecord = TestHelper . fakePlaybookChecklistItemModel ( {
81- updateAt : 112233 ,
82- conditionAction : '' ,
83- } ) ;
84- const raw = TestHelper . fakePlaybookChecklistItem ( existingRecord . checklistId , {
85- update_at : 112233 ,
86- condition_action : 'hidden' ,
87- } ) ;
88-
89- expect ( shouldHandlePlaybookChecklistItemRecord ( existingRecord , raw ) ) . toBe ( true ) ;
90- } ) ;
91-
92- it ( 'should return true when condition_reason changes even if update_at is the same' , ( ) => {
93- const existingRecord = TestHelper . fakePlaybookChecklistItemModel ( {
94- updateAt : 112233 ,
95- conditionReason : '' ,
96- } ) ;
97- const raw = TestHelper . fakePlaybookChecklistItem ( existingRecord . checklistId , {
98- update_at : 112233 ,
99- condition_reason : 'Dependent task not completed' ,
100- } ) ;
101-
102- expect ( shouldHandlePlaybookChecklistItemRecord ( existingRecord , raw ) ) . toBe ( true ) ;
103- } ) ;
104-
105- it ( 'should return false when condition fields are unchanged and update_at is the same' , ( ) => {
106- const existingRecord = TestHelper . fakePlaybookChecklistItemModel ( {
107- updateAt : 112233 ,
108- conditionAction : 'hidden' ,
109- conditionReason : 'Some reason' ,
110- } ) ;
111- const raw = TestHelper . fakePlaybookChecklistItem ( existingRecord . checklistId , {
112- update_at : 112233 ,
113- condition_action : 'hidden' ,
114- condition_reason : 'Some reason' ,
115- } ) ;
116-
117- expect ( shouldHandlePlaybookChecklistItemRecord ( existingRecord , raw ) ) . toBe ( false ) ;
118- } ) ;
119-
120- it ( 'should return true when condition_action changes from hidden to shown_because_modified' , ( ) => {
121- const existingRecord = TestHelper . fakePlaybookChecklistItemModel ( {
122- updateAt : 112233 ,
123- conditionAction : 'hidden' ,
124- } ) ;
125- const raw = TestHelper . fakePlaybookChecklistItem ( existingRecord . checklistId , {
126- update_at : 112233 ,
127- condition_action : 'shown_because_modified' ,
128- } ) ;
129-
130- expect ( shouldHandlePlaybookChecklistItemRecord ( existingRecord , raw ) ) . toBe ( true ) ;
131- } ) ;
132-
133- it ( 'should return false when condition_action is undefined in raw data' , ( ) => {
134- const existingRecord = TestHelper . fakePlaybookChecklistItemModel ( {
135- updateAt : 112233 ,
136- conditionAction : 'hidden' ,
137- } ) ;
138- const raw = TestHelper . fakePlaybookChecklistItem ( existingRecord . checklistId , {
139- update_at : 112233 ,
140- } ) ;
141- delete raw . condition_action ;
142-
143- expect ( shouldHandlePlaybookChecklistItemRecord ( existingRecord , raw ) ) . toBe ( false ) ;
144- } ) ;
14578} ) ;
0 commit comments