Commits
Nikunj Sharma authored fadcd2e0c6c
143 143 | |
144 144 | describe('if collection is selected and is admin', () => { |
145 145 | let scriptRequestSucceeded; |
146 146 | beforeEach((done) => { |
147 147 | spyOn((component as any).modalService, 'open').and.returnValue(modalRef); |
148 148 | component.navigate(mockCollection).subscribe((succeeded: boolean) => { |
149 149 | scriptRequestSucceeded = succeeded; |
150 150 | done(); |
151 151 | }); |
152 152 | }); |
153 - | it('should invoke the batch-export script with option --id uuid and -a option', () => { |
153 + | it('should invoke the batch-export script with option --id uuid option', () => { |
154 154 | const parameterValues: ProcessParameter[] = [ |
155 155 | Object.assign(new ProcessParameter(), { name: '--id', value: mockCollection.uuid }), |
156 156 | Object.assign(new ProcessParameter(), { name: '--type', value: 'COLLECTION' }), |
157 - | Object.assign(new ProcessParameter(), { name: '-a' }), |
158 157 | ]; |
159 158 | expect(scriptService.invoke).toHaveBeenCalledWith(BATCH_EXPORT_SCRIPT_NAME, parameterValues, []); |
160 159 | }); |
161 160 | it('success notification is shown', () => { |
162 161 | expect(scriptRequestSucceeded).toBeTrue(); |
163 162 | expect(notificationService.success).toHaveBeenCalled(); |
164 163 | }); |
165 164 | it('redirected to process page', () => { |
166 165 | expect(router.navigateByUrl).toHaveBeenCalledWith('/processes/45'); |
167 166 | }); |
168 167 | }); |
169 168 | describe('if collection is selected and is not admin', () => { |
170 169 | let scriptRequestSucceeded; |
171 170 | beforeEach((done) => { |
172 171 | (authorizationDataService.isAuthorized as jasmine.Spy).and.returnValue(observableOf(false)); |
173 172 | spyOn((component as any).modalService, 'open').and.returnValue(modalRef); |
174 173 | component.navigate(mockCollection).subscribe((succeeded: boolean) => { |
175 174 | scriptRequestSucceeded = succeeded; |
176 175 | done(); |
177 176 | }); |
178 177 | }); |
179 - | it('should invoke the Batch-export script with option --id uuid without the -a option', () => { |
178 + | it('should invoke the Batch-export script with option --id uuid without option', () => { |
180 179 | const parameterValues: ProcessParameter[] = [ |
181 180 | Object.assign(new ProcessParameter(), { name: '--id', value: mockCollection.uuid }), |
182 181 | Object.assign(new ProcessParameter(), { name: '--type', value: 'COLLECTION' }) |
183 182 | ]; |
184 183 | expect(scriptService.invoke).toHaveBeenCalledWith(BATCH_EXPORT_SCRIPT_NAME, parameterValues, []); |
185 184 | }); |
186 185 | it('success notification is shown', () => { |
187 186 | expect(scriptRequestSucceeded).toBeTrue(); |
188 187 | expect(notificationService.success).toHaveBeenCalled(); |
189 188 | }); |