Working signout button
This commit is contained in:
@@ -173,6 +173,8 @@ def test_public_and_admin_pages_render_html():
|
||||
root_page = client.get('/')
|
||||
assert 'LinkLog' in root_page.text
|
||||
assert 'class="login-button" href="/login"' in root_page.text
|
||||
assert 'id="auth-session" class="auth-session hidden"' in root_page.text
|
||||
assert 'logout.js?v=3' in root_page.text
|
||||
assert client.get('/alice').status_code == 200
|
||||
assert client.get('/alice/').status_code == 200
|
||||
user_page = client.get('/alice').text
|
||||
@@ -182,14 +184,17 @@ def test_public_and_admin_pages_render_html():
|
||||
feed_script = TestClient(app).get('/static/feed.js?v=4').text
|
||||
assert 'window.location.assign(selectedUser ? `/${encodeURIComponent(selectedUser)}/` : \'/\')' in feed_script
|
||||
assert client.get('/login').status_code == 200
|
||||
assert 'Sign in' in client.get('/login').text
|
||||
login_page = client.get('/login').text
|
||||
assert 'Sign in' in login_page
|
||||
assert 'id="auth-session" class="auth-session hidden"' in login_page
|
||||
assert 'logout.js?v=3' in login_page
|
||||
assert client.get('/admin').status_code == 200
|
||||
admin_page = client.get('/admin').text
|
||||
assert 'Admin' in admin_page
|
||||
assert 'id="admin-controls" class="hidden"' in admin_page
|
||||
assert 'id="admin-auth-notice" class="auth-notice hidden"' in admin_page
|
||||
assert 'id="admin-login-button" class="login-button" href="/login"' in admin_page
|
||||
assert 'id="logout-button" class="logout-button hidden"' in admin_page
|
||||
assert 'id="auth-session" class="auth-session hidden"' in admin_page
|
||||
feed_script = client.get('/static/feed.js?v=5').text
|
||||
assert 'if (item.is_owner)' in feed_script
|
||||
|
||||
|
||||
Reference in New Issue
Block a user