Change '.focused-tweet' to '#focused-tweet'; tidy up 'tests.sh'

This commit is contained in:
Alessio 2023-10-14 20:08:15 -03:00
parent b6ada6371c
commit 2e0e307b93
6 changed files with 14 additions and 15 deletions

View File

@ -340,7 +340,7 @@ tw fetch_tweet_only https://twitter.com/PandasAndVidya/status/156271472796842803
test "$(sqlite3 twitter.db "select count(*) from tweets where id = 156271472796842803")" == "0" test "$(sqlite3 twitter.db "select count(*) from tweets where id = 156271472796842803")" == "0"
# Fetch an age-restricted tweet while logged in # Fetch an age-restricted tweet while logged in
tw --session Offline_Twatter fetch_tweet_only https://twitter.com/PandasAndVidya/status/1562714727968428032 tw fetch_tweet_only https://twitter.com/PandasAndVidya/status/1562714727968428032
test "$(sqlite3 twitter.db "select count(*) from tweets where id = 156271472796842803")" == "0" test "$(sqlite3 twitter.db "select count(*) from tweets where id = 156271472796842803")" == "0"
# Test that you can pass a session with the `.session` file extension too # Test that you can pass a session with the `.session` file extension too
@ -348,13 +348,13 @@ tw --session Offline_Twatter.session list_followed > /dev/null # Dummy operatio
# Test search # Test search
tw --session Offline_Twatter search "from:michaelmalice constitution" tw search "from:michaelmalice constitution"
test $(sqlite3 twitter.db "select count(*) from tweets where user_id = 44067298 and text like '%constitution%'") -gt "30" # Not sure exactly how many test $(sqlite3 twitter.db "select count(*) from tweets where user_id = 44067298 and text like '%constitution%'") -gt "30" # Not sure exactly how many
# Test fetching user Likes # Test fetching user Likes
tw fetch_user Offline_Twatter tw fetch_user Offline_Twatter
tw --session Offline_Twatter get_user_likes Offline_Twatter tw get_user_likes Offline_Twatter
test $(sqlite3 twitter.db "select count(*) from likes") -ge "2" test $(sqlite3 twitter.db "select count(*) from likes") -ge "2"
test $(sqlite3 twitter.db "select count(*) from likes where tweet_id = 1671902735250124802") = "1" test $(sqlite3 twitter.db "select count(*) from likes where tweet_id = 1671902735250124802") = "1"
@ -362,9 +362,9 @@ test $(sqlite3 twitter.db "select count(*) from likes where tweet_id = 167190273
# Test liking and unliking # Test liking and unliking
tw fetch_tweet_only 1589023388676554753 tw fetch_tweet_only 1589023388676554753
test $(sqlite3 twitter.db "select count(*) from likes where tweet_id = 1589023388676554753 and user_id = (select id from users where handle like 'offline_twatter')") = "0" test $(sqlite3 twitter.db "select count(*) from likes where tweet_id = 1589023388676554753 and user_id = (select id from users where handle like 'offline_twatter')") = "0"
tw --session Offline_Twatter like_tweet https://twitter.com/elonmusk/status/1589023388676554753 tw like_tweet https://twitter.com/elonmusk/status/1589023388676554753
test $(sqlite3 twitter.db "select count(*) from likes where tweet_id = 1589023388676554753 and user_id = (select id from users where handle like 'offline_twatter')") = "1" test $(sqlite3 twitter.db "select count(*) from likes where tweet_id = 1589023388676554753 and user_id = (select id from users where handle like 'offline_twatter')") = "1"
tw --session Offline_Twatter unlike_tweet https://twitter.com/elonmusk/status/1589023388676554753 tw unlike_tweet https://twitter.com/elonmusk/status/1589023388676554753
# TODO: implement deleting a Like # TODO: implement deleting a Like
# test $(sqlite3 twitter.db "select count(*) from likes where tweet_id = 1589023388676554753 and user_id = (select id from users where handle like 'offline_twatter')") = "0" # test $(sqlite3 twitter.db "select count(*) from likes where tweet_id = 1589023388676554753 and user_id = (select id from users where handle like 'offline_twatter')") = "0"
@ -372,4 +372,3 @@ tw --session Offline_Twatter unlike_tweet https://twitter.com/elonmusk/status/15
# TODO: Maybe this file should be broken up into multiple test scripts # TODO: Maybe this file should be broken up into multiple test scripts
echo -e "\033[32mAll tests passed. Finished successfully.\033[0m" echo -e "\033[32mAll tests passed. Finished successfully.\033[0m"

View File

@ -68,7 +68,7 @@ ul.inline-dotted-list li:last-child:after {
.tweet { .tweet {
padding: 0 1.5em; padding: 0 1.5em;
} }
:not(.focused-tweet) > .tweet { :not(#focused-tweet) > .tweet {
cursor: pointer; cursor: pointer;
} }
@ -153,10 +153,10 @@ a.entity {
margin-bottom: 0.4em; margin-bottom: 0.4em;
margin-top: 0; margin-top: 0;
} }
.focused-tweet .text { #focused-tweet .text {
font-size: 1.4em; font-size: 1.4em;
} }
.focused-tweet .quoted-tweet .text { #focused-tweet .quoted-tweet .text {
font-size: unset; font-size: unset;
} }
.tweet-content video { .tweet-content video {
@ -188,7 +188,7 @@ h3 {
.embedded-link-domain { .embedded-link-domain {
margin-left: 0.3em; margin-left: 0.3em;
} }
.thread-parent-tweet:first-child, .focused-tweet:first-child { .thread-parent-tweet:first-child, #focused-tweet:first-child {
padding-top: 1em; padding-top: 1em;
} }
.thread-parent-tweet .vertical-reply-line-container, .thread-parent-tweet .vertical-reply-line-container,
@ -284,7 +284,7 @@ p.posted-at {
flex-grow: 5; flex-grow: 5;
} }
.focused-tweet { #focused-tweet {
border-bottom: 1px solid var(--color-twitter-off-white-dark); border-bottom: 1px solid var(--color-twitter-off-white-dark);
padding-bottom: 0.5em; padding-bottom: 0.5em;
} }

View File

@ -15,7 +15,7 @@
<img class="svg-icon" src="/static/icons/back.svg" /> <img class="svg-icon" src="/static/icons/back.svg" />
</a> </a>
<form hx-get="/search" hx-push-url="true" hx-target="body" hx-swap="inner-html show:window:top"> <form hx-get="/search" hx-push-url="true" hx-target="body" hx-swap="inner-html show:window:top">
<input name="q" class="search-bar" placeholder="Search" type="text" /> <input id="search-bar" name="q" class="search-bar" placeholder="Search" type="text" />
</form> </form>
</div> </div>
{{template "nav-sidebar"}} {{template "nav-sidebar"}}

View File

@ -13,7 +13,7 @@
<span>Home</span> <span>Home</span>
</li> </li>
</a> </a>
<a class="unstyled-link" href="#"> <a class="unstyled-link" onclick="document.querySelector('#search-bar').focus()">
<li class="quick-link"> <li class="quick-link">
<img class="svg-icon" src="/static/icons/explore.svg" /> <img class="svg-icon" src="/static/icons/explore.svg" />
<span>Explore</span> <span>Explore</span>

View File

@ -7,7 +7,7 @@
{{template "tweet" (dict "TweetID" . "RetweetID" 0 "QuoteNestingLevel" 0)}} {{template "tweet" (dict "TweetID" . "RetweetID" 0 "QuoteNestingLevel" 0)}}
</div> </div>
{{end}} {{end}}
<div class="focused-tweet"> <div id="focused-tweet">
{{template "tweet" (dict "TweetID" .MainTweetID "RetweetID" 0 "QuoteNestingLevel" 0)}} {{template "tweet" (dict "TweetID" .MainTweetID "RetweetID" 0 "QuoteNestingLevel" 0)}}
</div> </div>

View File

@ -6,7 +6,7 @@
hx-post="/tweet/{{$main_tweet.ID}}" hx-post="/tweet/{{$main_tweet.ID}}"
hx-trigger="click" hx-trigger="click"
hx-target="body" hx-target="body"
hx-swap="outerHTML" hx-swap="outerHTML show:#focused-tweet:top"
hx-push-url="true" hx-push-url="true"
{{end}} {{end}}
> >