Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: Add Hebrew translations and RTL support #49

Merged
merged 3 commits into from
Oct 14, 2022
Merged
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
Next Next commit
ci: Add rtl tests
  • Loading branch information
DenverCoder1 committed Oct 14, 2022
commit d82439e740472e2c13ba7fdde5275fbda20a5e19
20 changes: 20 additions & 0 deletions tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,23 @@ def test_request_valid_params(client):
# test timestamp
timestamp_regex = re.compile(r"\d+ years ago")
assert timestamp_regex.search(data) is not None


def test_request_right_to_left(client):
params = {
"id": "dQw4w9WgXcQ",
"title": "Rick Astley - Never Gonna Give You Up (Official Music Video)",
"timestamp": "1256450400",
"lang": "he",
}
response = client.get(f"/?{urlencode(params)}")
data = response.data.decode("utf-8")

# stats group should be 10 pixels from the right
assert "translate(240, 195.0)" in data

assert 'style="direction: rtl"' in data

# test views
views_regex = re.compile(r"\d+(?:\.\d)?[KMBT]? צפיות")
assert views_regex.search(data) is not None