Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 1 addition & 60 deletions app/cypress/e2e/critical_flows.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,63 +3,4 @@ describe('Critical Event App Flows', () => {
cy.visit('/');
// Set mock user session using our Cypress hook
cy.window().then(win => {
win.setMockUser(
{
uid: 'student-test-uid',
displayName: 'Jane Doe',
email: 'jane.doe@uni.edu',
},
'student',
{
name: 'Jane Doe',
email: 'jane.doe@uni.edu',
branch: 'Computer Science',
year: '3rd Year',
points: 120,
},
);
});
});

it('should render the event feed home page correctly', () => {
// Verify welcome text is loaded from the mock user displayName
cy.contains('Welcome,').should('be.visible');
cy.contains('Jane Doe').should('be.visible');

// Verify search bar is visible
cy.get('input[placeholder="Search events..."]').should('be.visible');

// Verify recommendations section header is visible
cy.contains('RECOMMENDED FOR YOU').should('be.visible');
});

it('should support tab navigation to Leaderboard and Profile', () => {
// We should be able to navigate to Leaderboard using tab bar
cy.contains('Rankings').click();

// Verify Leaderboard screen is shown
cy.contains('LEADERBOARD').should('be.visible');
cy.contains('Top Contributors').should('be.visible');

// Navigate to Profile using tab bar
cy.contains('Profile').click();

// Verify Profile screen renders correctly
cy.contains('Jane Doe').should('be.visible');
cy.contains('jane.doe@uni.edu').should('be.visible');
cy.contains('Computer Science').should('be.visible');
cy.contains('3rd Year').should('be.visible');
cy.contains('Student Settings').should('be.visible');
});

it('should allow searching for events in the feed', () => {
const searchQuery = 'Hackathon';
// Type search query
cy.get('input[placeholder="Search events..."]')
.type(searchQuery)
.should('have.value', searchQuery);

// Verify close icon appears via stable testID
cy.get('[data-testid="clear-search-button"]').should('exist');
});
});
.catch(err => console.error(err))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

for file in \
  app/cypress/e2e/critical_flows.cy.js \
  app/src/screens/AttendanceDashboard.js
do
  ast-grep outline "$file" --items all
done

rg -n -C 10 'setMockUser|cy\.window\(\)|getDoc|getAttendanceStats|\.catch\(' \
  app/cypress/e2e/critical_flows.cy.js \
  app/src/screens/AttendanceDashboard.js \
  app/src/lib/AuthContext.js \
  app/src/lib/checkInService.js \
  app/src/screens/EventDetail.js

Repository: roshankumar0036singh/Uni-Event

Length of output: 28298


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== files =="
wc -l app/cypress/e2e/critical_flows.cy.js app/src/screens/AttendanceDashboard.js app/src/lib/checkInService.js app/src/screens/EventDetail.js

echo "== critical_flows.cy.js =="
cat -n app/cypress/e2e/critical_flows.cy.js

echo "== AttendanceDashboard.js relevant end scope =="
sed -n '120,220p' app/src/screens/AttendanceDashboard.js | cat -n -v

echo "== AttendanceDashboard.js imports/functions outline snippets =="
sed -n '1,130p' app/src/screens/AttendanceDashboard.js | cat -n -v

Repository: roshankumar0036singh/Uni-Event

Length of output: 8093


Restore the deleted code before merging the rejection logging.

Both files leave behind a dangling .catch after removing the callback body, so the files fail parsing and lose existing behavior.

  • app/cypress/e2e/critical_flows.cy.js:5: Restore setMockUser and the critical-flow assertions, close cy.window().then(...), and use Cypress failure behavior instead of appending .catch to the Cypress chain.
  • app/src/screens/AttendanceDashboard.js:165: Restore the event-data fetch, listeners, UI, and route behavior, close the component/request scope, and preserve getAttendanceStats null-on-error behavior.
🧰 Tools
🪛 Biome (2.5.5)

[error] 6-6: Expected a statement but instead found '.catch(err => console.error(err))'.

(parse)


[error] 6-6: expected } but instead the file ends

(parse)

📍 Affects 2 files
  • app/cypress/e2e/critical_flows.cy.js#L6-L6 (this comment)
  • app/src/screens/AttendanceDashboard.js#L167-L167
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/cypress/e2e/critical_flows.cy.js` at line 6, Restore the removed
implementations at app/cypress/e2e/critical_flows.cy.js:5-6 and
app/src/screens/AttendanceDashboard.js:167. In critical_flows.cy.js, reinstate
setMockUser and the critical-flow assertions, close cy.window().then(...), and
rely on Cypress failure handling rather than appending .catch. In
AttendanceDashboard.js, restore event-data fetching, listeners, UI, routing,
component/request closure, and preserve getAttendanceStats returning null on
errors.

Source: Linters/SAST tools

Loading