Change '.focused-tweet' to '#focused-tweet'; tidy up 'tests.sh'
This commit is contained in:
parent
b6ada6371c
commit
2e0e307b93
11
cmd/tests.sh
11
cmd/tests.sh
@ -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"
|
||||
|
||||
# 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 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
|
||||
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 fetching user Likes
|
||||
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 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
|
||||
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"
|
||||
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"
|
||||
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
|
||||
# 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
|
||||
|
||||
echo -e "\033[32mAll tests passed. Finished successfully.\033[0m"
|
||||
|
||||
|
@ -68,7 +68,7 @@ ul.inline-dotted-list li:last-child:after {
|
||||
.tweet {
|
||||
padding: 0 1.5em;
|
||||
}
|
||||
:not(.focused-tweet) > .tweet {
|
||||
:not(#focused-tweet) > .tweet {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@ -153,10 +153,10 @@ a.entity {
|
||||
margin-bottom: 0.4em;
|
||||
margin-top: 0;
|
||||
}
|
||||
.focused-tweet .text {
|
||||
#focused-tweet .text {
|
||||
font-size: 1.4em;
|
||||
}
|
||||
.focused-tweet .quoted-tweet .text {
|
||||
#focused-tweet .quoted-tweet .text {
|
||||
font-size: unset;
|
||||
}
|
||||
.tweet-content video {
|
||||
@ -188,7 +188,7 @@ h3 {
|
||||
.embedded-link-domain {
|
||||
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;
|
||||
}
|
||||
.thread-parent-tweet .vertical-reply-line-container,
|
||||
@ -284,7 +284,7 @@ p.posted-at {
|
||||
flex-grow: 5;
|
||||
}
|
||||
|
||||
.focused-tweet {
|
||||
#focused-tweet {
|
||||
border-bottom: 1px solid var(--color-twitter-off-white-dark);
|
||||
padding-bottom: 0.5em;
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
<img class="svg-icon" src="/static/icons/back.svg" />
|
||||
</a>
|
||||
<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>
|
||||
</div>
|
||||
{{template "nav-sidebar"}}
|
||||
|
@ -13,7 +13,7 @@
|
||||
<span>Home</span>
|
||||
</li>
|
||||
</a>
|
||||
<a class="unstyled-link" href="#">
|
||||
<a class="unstyled-link" onclick="document.querySelector('#search-bar').focus()">
|
||||
<li class="quick-link">
|
||||
<img class="svg-icon" src="/static/icons/explore.svg" />
|
||||
<span>Explore</span>
|
||||
|
@ -7,7 +7,7 @@
|
||||
{{template "tweet" (dict "TweetID" . "RetweetID" 0 "QuoteNestingLevel" 0)}}
|
||||
</div>
|
||||
{{end}}
|
||||
<div class="focused-tweet">
|
||||
<div id="focused-tweet">
|
||||
{{template "tweet" (dict "TweetID" .MainTweetID "RetweetID" 0 "QuoteNestingLevel" 0)}}
|
||||
</div>
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
hx-post="/tweet/{{$main_tweet.ID}}"
|
||||
hx-trigger="click"
|
||||
hx-target="body"
|
||||
hx-swap="outerHTML"
|
||||
hx-swap="outerHTML show:#focused-tweet:top"
|
||||
hx-push-url="true"
|
||||
{{end}}
|
||||
>
|
||||
|
Loading…
x
Reference in New Issue
Block a user