Skip to content

Commit

Permalink
headers + listings
Browse files Browse the repository at this point in the history
  • Loading branch information
codekansas committed Jul 31, 2024
1 parent 4882f5b commit 48957c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion frontend/src/components/ui/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface HeaderProps {
const Header = ({ label }: HeaderProps) => {
return (
<div className="w-full flex flex-col items-center justify-center gap-y-4">
<h1 className={cn("text-3xl font-semibold")}>RoboList</h1>
<h1 className={cn("text-3xl font-semibold")}>Robolist</h1>
{label && <p className="text-muted-foreground text-s,">{label}</p>}
</div>
);
Expand Down
16 changes: 6 additions & 10 deletions tests/test_listings.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,11 @@ async def test_listings(app_client: AsyncClient, tmpdir: Path) -> None:
)
assert response.status_code == status.HTTP_200_OK, response.json()
data = response.json()
items, has_next = data["listings"], data["has_next"]
items, has_next = data["listing_ids"], data["has_next"]
assert len(items) == 1
assert not has_next

# Checks the item.
item = data["listings"][0]
assert item["name"] == "test listing"
assert item["description"] == "test description"
assert item["child_ids"] == []
listing_ids = data["listing_ids"]
assert listing_ids == [listing_id]

# Checks my own listings.
response = await app_client.get(
Expand All @@ -71,12 +67,12 @@ async def test_listings(app_client: AsyncClient, tmpdir: Path) -> None:
)
assert response.status_code == status.HTTP_200_OK, response.json()
data = response.json()
items, has_next = data["listings"], data["has_next"]
items, has_next = data["listing_ids"], data["has_next"]
assert len(items) == 1
assert not has_next

# Gets the listing by ID.
listing_id = item["id"]
listing_id = listing_ids[0]
response = await app_client.get(f"/listings/{listing_id}", headers=auth_headers)
assert response.status_code == status.HTTP_200_OK, response.json()

Expand All @@ -100,6 +96,6 @@ async def test_listings(app_client: AsyncClient, tmpdir: Path) -> None:
)
assert response.status_code == status.HTTP_200_OK, response.json()
data = response.json()
items, has_next = data["listings"], data["has_next"]
items, has_next = data["listing_ids"], data["has_next"]
assert len(items) == 0
assert not has_next

0 comments on commit 48957c6

Please sign in to comment.