Skip to content

Commit

Permalink
add and modify tests for new changes
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelCenzano committed Oct 31, 2023
1 parent 11c284a commit 19a0e00
Showing 1 changed file with 44 additions and 3 deletions.
47 changes: 44 additions & 3 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,32 @@ def test_home_page(test_client) -> None:
assert b"Your Recommendations" in response.data


def test_positions_page(test_client) -> None:
def test_opportunities_page(test_client) -> None:
"""
GIVEN a Flask application configured for testing
WHEN the '/positions' page is requested (GET)
WHEN the '/opportunities' page is requested (GET)
THEN check that the response is valid
"""
response = test_client.get("/positions")
response = test_client.get("/opportunities")
assert response.status_code == 200
assert b"Applied" in response.data
assert b"Saved" in response.data
assert b"Filters" in response.data


def test_opportunity_detail_page(test_client) -> None:
"""
GIVEN a Flask application configured for testing
WHEN the '/opportunity/<int:id>' page is requested (GET)
THEN check that the response is valid
"""
response = test_client.get("/opportunity/4")
assert response.status_code == 200
assert b"Quantum Computing to solve NP-Complete Problems" in response.data
assert b"About This Role" in response.data
assert b"Deadline" in response.data


def test_discover_page(test_client) -> None:
"""
GIVEN a Flask application configured for testing
Expand Down Expand Up @@ -105,3 +118,31 @@ def test_profile_page(test_client) -> None:
assert b"Name:" in response.data
assert b"Department:" in response.data
assert b"Contact:" in response.data


def test_tips_and_tricks_page(test_client) -> None:
"""
GIVEN a Flask application configured for testing
WHEN the '/profile/<user>' page is requested (GET)
THEN check that the response is valid
"""
response = test_client.get("/tips")
assert response.status_code == 200
assert b"Tips and Tricks for LabConnect" in response.data


def test_info_page(test_client) -> None:
"""
GIVEN a Flask application configured for testing
WHEN the '/profile/<user>' page is requested (GET)
THEN check that the response is valid
"""
response = test_client.get("/info")
assert response.status_code == 200
assert b"URP for Credit" in response.data
assert b"URP for Funding" in response.data

response = test_client.get("/information")
assert response.status_code == 200
assert b"URP for Credit" in response.data
assert b"URP for Funding" in response.data

0 comments on commit 19a0e00

Please sign in to comment.