Spaces:
Building
Building
Update flare-ui/src/app/components/test/test.component.ts
Browse files
flare-ui/src/app/components/test/test.component.ts
CHANGED
@@ -229,9 +229,10 @@ export class TestComponent implements OnInit {
|
|
229 |
});
|
230 |
|
231 |
// Integration Tests
|
|
|
232 |
this.addTest('integration', 'Create and delete project', async () => {
|
233 |
const start = Date.now();
|
234 |
-
let projectId: number | null
|
235 |
|
236 |
try {
|
237 |
// Create project
|
@@ -246,8 +247,8 @@ export class TestComponent implements OnInit {
|
|
246 |
|
247 |
projectId = createResponse.id;
|
248 |
|
249 |
-
// Delete project
|
250 |
-
await this.apiService.deleteProject(projectId
|
251 |
|
252 |
return {
|
253 |
name: 'Create and delete project',
|
@@ -257,7 +258,7 @@ export class TestComponent implements OnInit {
|
|
257 |
};
|
258 |
} catch (error: any) {
|
259 |
// Try to clean up if project was created
|
260 |
-
if (projectId !==
|
261 |
try {
|
262 |
await this.apiService.deleteProject(projectId).toPromise();
|
263 |
} catch {}
|
|
|
229 |
});
|
230 |
|
231 |
// Integration Tests
|
232 |
+
// Integration Tests
|
233 |
this.addTest('integration', 'Create and delete project', async () => {
|
234 |
const start = Date.now();
|
235 |
+
let projectId: number | undefined; // null yerine undefined kullan
|
236 |
|
237 |
try {
|
238 |
// Create project
|
|
|
247 |
|
248 |
projectId = createResponse.id;
|
249 |
|
250 |
+
// Delete project
|
251 |
+
await this.apiService.deleteProject(projectId).toPromise();
|
252 |
|
253 |
return {
|
254 |
name: 'Create and delete project',
|
|
|
258 |
};
|
259 |
} catch (error: any) {
|
260 |
// Try to clean up if project was created
|
261 |
+
if (projectId !== undefined) { // undefined kontrolü
|
262 |
try {
|
263 |
await this.apiService.deleteProject(projectId).toPromise();
|
264 |
} catch {}
|