mirror of
https://github.com/sissbruecker/linkding.git
synced 2025-08-09 03:37:54 +02:00

* start converting * small fixes * reorganize theme files * cleanup search bar * increase spacing * small tweaks * fix select styles in Chrome * cleanup menus * improve button icons * restore badges * remove unused classes * restore some overrides * restore bookmark form * add summary outline * avoid layout shifts * restore bookmark details * increase border radius for modals * improve details modal * restore reader mode * restore settings * cleanup variables * start with dark theme * more dark theme... * more light theme... * more dark theme... * add postcss build * remove sass processor * update docker build * fix alt color * remove endless symbol * fix tests * update assets * remove sass files * fix docker build * cleanup spacing * improve theme * update test scripts * update CI workflow * fix test
39 lines
1.1 KiB
Python
39 lines
1.1 KiB
Python
from django.test import TestCase
|
|
from django.urls import reverse
|
|
|
|
from bookmarks.tests.helpers import BookmarkFactoryMixin
|
|
|
|
|
|
class NavMenuTestCase(TestCase, BookmarkFactoryMixin):
|
|
|
|
def setUp(self) -> None:
|
|
user = self.get_or_create_test_user()
|
|
self.client.force_login(user)
|
|
|
|
def test_should_respect_share_profile_setting(self):
|
|
self.user.profile.enable_sharing = False
|
|
self.user.profile.save()
|
|
response = self.client.get(reverse("bookmarks:index"))
|
|
html = response.content.decode()
|
|
|
|
self.assertInHTML(
|
|
f"""
|
|
<a href="{reverse('bookmarks:shared')}" class="menu-link">Shared</a>
|
|
""",
|
|
html,
|
|
count=0,
|
|
)
|
|
|
|
self.user.profile.enable_sharing = True
|
|
self.user.profile.save()
|
|
response = self.client.get(reverse("bookmarks:index"))
|
|
html = response.content.decode()
|
|
|
|
self.assertInHTML(
|
|
f"""
|
|
<a href="{reverse('bookmarks:shared')}" class="menu-link">Shared</a>
|
|
""",
|
|
html,
|
|
count=2,
|
|
)
|