Skip to content

Commit b84bab8

Browse files
committed
Fix integration tests
1 parent de6f2dc commit b84bab8

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

cypress/e2e/use-cases/android.cy.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('Use case: Analysing Android apps', () => {
6565
cy.contains('To Whom It May Concern:');
6666

6767
cy.get('#upload').selectFile('cypress/fixtures/qd/notice.eml');
68-
cy.get('button').contains('Upload').click();
68+
cy.get('button').contains('Upload').scrollIntoView().click({ force: true });
6969

7070
cy.contains('Waiting for the developer');
7171
cy.get('#upload');
@@ -101,19 +101,19 @@ describe('Use case: Analysing Android apps', () => {
101101
cy.contains('Irish Data Protection Commission').click();
102102

103103
cy.contains('How to contact the DPA about the app?');
104-
if (useCase === 'informal-complaint') cy.contains('Informally ask the DPA to look in the app').click();
104+
if (useCase === 'informal-complaint') cy.contains('Informally ask the DPA to look into the app').click();
105105
else cy.contains('Check whether I am personally affected').click();
106106

107107
if (useCase === 'formal-complaint') {
108108
cy.contains('Prove that you are affected by the tracking');
109109

110110
cy.get('#upload').selectFile('cypress/fixtures/qd/trackercontrol.csv');
111-
cy.get('button').contains('Upload').click();
111+
cy.get('button').contains('Upload').scrollIntoView().click({ force: true });
112112

113113
cy.contains('How did you install the app?');
114114
cy.contains('through the Google Play Store').click();
115115

116-
cy.contains('Do you have a SIM card in your phone?');
116+
cy.contains('Do you have a SIM card in your device?');
117117
cy.contains('I have a SIM card').click();
118118
}
119119

src/pages/p/[platform]/[appId]/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export const POST: APIRoute = async ({ params, redirect, currentLocale, clientAd
2424

2525
const { token: analysisToken } = await startAnalysis(platform, appMeta.appId);
2626

27-
await e
28-
.insert(e.Proceeding, {
27+
try {
28+
e.insert(e.Proceeding, {
2929
app: e
3030
.insert(e.App, {
3131
platform,
@@ -51,8 +51,10 @@ export const POST: APIRoute = async ({ params, redirect, currentLocale, clientAd
5151
type: 'initial',
5252
token: analysisToken,
5353
}),
54-
})
55-
.run(client);
54+
}).run(client);
55+
} catch (err) {
56+
return new Response('Database Error', { status: 500 });
57+
}
5658

5759
return redirect(`/p/${token}`);
5860
};

0 commit comments

Comments
 (0)