Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature/ Add public points display on index page and welcome page #255

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
Prev Previous commit
Add test for points display board feature
  • Loading branch information
LuuNa-JD committed Nov 13, 2024
commit d0dd0a8f09a9b849d72f6052f48043d50900fef7
37 changes: 37 additions & 0 deletions tests/unit/test_points_display.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import sys
import os
import pytest
sys.path.insert(
0, os.path.abspath(
os.path.join(os.path.dirname(__file__), '../../')
)
)

from server import app, clubs, competitions # noqa


@pytest.fixture
def client():
app.config['TESTING'] = True
with app.test_client() as client:
yield client


def test_points_display_on_index(client):
response = client.get('/')
assert response.status_code == 200

for club in clubs:
assert bytes(club['name'], 'utf-8') in response.data
assert bytes(club['points'], 'utf-8') in response.data


def test_points_display_after_login(client):
response = client.post(
'/showSummary', data={'email': 'john@simplylift.co'}
)
assert response.status_code == 200

for club in clubs:
assert bytes(club['name'], 'utf-8') in response.data
assert bytes(club['points'], 'utf-8') in response.data