test: rename test_event to test_note
This commit is contained in:
@@ -349,11 +349,11 @@ struct EventActionBar_Previews: PreviewProvider {
|
||||
|
||||
let bar = ActionBarModel.empty()
|
||||
let likedbar = ActionBarModel(likes: 10, boosts: 0, zaps: 0, zap_total: 0, replies: 0, our_like: nil, our_boost: nil, our_zap: nil, our_reply: nil)
|
||||
let likedbar_ours = ActionBarModel(likes: 10, boosts: 0, zaps: 0, zap_total: 0, replies: 0, our_like: test_event, our_boost: nil, our_zap: nil, our_reply: nil)
|
||||
let maxed_bar = ActionBarModel(likes: 999, boosts: 999, zaps: 999, zap_total: 99999999, replies: 999, our_like: test_event, our_boost: test_event, our_zap: nil, our_reply: nil)
|
||||
let extra_max_bar = ActionBarModel(likes: 9999, boosts: 9999, zaps: 9999, zap_total: 99999999, replies: 9999, our_like: test_event, our_boost: test_event, our_zap: nil, our_reply: test_event)
|
||||
let mega_max_bar = ActionBarModel(likes: 9999999, boosts: 99999, zaps: 9999, zap_total: 99999999, replies: 9999999, our_like: test_event, our_boost: test_event, our_zap: .zap(test_zap), our_reply: test_event)
|
||||
|
||||
let likedbar_ours = ActionBarModel(likes: 10, boosts: 0, zaps: 0, zap_total: 0, replies: 0, our_like: test_note, our_boost: nil, our_zap: nil, our_reply: nil)
|
||||
let maxed_bar = ActionBarModel(likes: 999, boosts: 999, zaps: 999, zap_total: 99999999, replies: 999, our_like: test_note, our_boost: test_note, our_zap: nil, our_reply: nil)
|
||||
let extra_max_bar = ActionBarModel(likes: 9999, boosts: 9999, zaps: 9999, zap_total: 99999999, replies: 9999, our_like: test_note, our_boost: test_note, our_zap: nil, our_reply: test_note)
|
||||
let mega_max_bar = ActionBarModel(likes: 9999999, boosts: 99999, zaps: 9999, zap_total: 99999999, replies: 9999999, our_like: test_note, our_boost: test_note, our_zap: .zap(test_zap), our_reply: test_note)
|
||||
|
||||
VStack(spacing: 50) {
|
||||
EventActionBar(damus_state: ds, event: ev, bar: bar)
|
||||
|
||||
|
||||
@@ -61,6 +61,6 @@ struct RepostAction: View {
|
||||
|
||||
struct RepostAction_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
RepostAction(damus_state: test_damus_state(), event: test_event)
|
||||
RepostAction(damus_state: test_damus_state(), event: test_note)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ struct EventView_Previews: PreviewProvider {
|
||||
|
||||
*/
|
||||
|
||||
EventView( damus: test_damus_state(), event: test_event )
|
||||
EventView( damus: test_damus_state(), event: test_note )
|
||||
|
||||
EventView( damus: test_damus_state(), event: test_longform_event.event, options: [.wide] )
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ struct BuilderEventView: View {
|
||||
|
||||
struct BuilderEventView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
BuilderEventView(damus: test_damus_state(), event_id: "536bee9e83c818e3b82c101935128ae27a0d4290039aaf253efe5f09232c1962")
|
||||
BuilderEventView(damus: test_damus_state(), event_id: test_note.id)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,6 @@ struct EventTop: View {
|
||||
|
||||
struct EventTop_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
EventTop(state: test_damus_state(), event: test_event, pubkey: test_event.pubkey, is_anon: false)
|
||||
EventTop(state: test_damus_state(), event: test_note, pubkey: test_note.pubkey, is_anon: false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ struct ReplyDescription: View {
|
||||
|
||||
struct ReplyDescription_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ReplyDescription(event: test_event, profiles: test_damus_state().profiles)
|
||||
ReplyDescription(event: test_note, profiles: test_damus_state().profiles)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,6 @@ struct ReplyPart: View {
|
||||
|
||||
struct ReplyPart_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ReplyPart(event: test_event, privkey: nil, profiles: test_damus_state().profiles)
|
||||
ReplyPart(event: test_note, privkey: nil, profiles: test_damus_state().profiles)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,6 @@ struct EventBody: View {
|
||||
|
||||
struct EventBody_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
EventBody(damus_state: test_damus_state(), event: test_event, size: .normal, options: [])
|
||||
EventBody(damus_state: test_damus_state(), event: test_note, size: .normal, options: [])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,6 @@ struct EventProfile: View {
|
||||
|
||||
struct EventProfile_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
EventProfile(damus_state: test_damus_state(), pubkey: "pk", profile: nil, size: .normal)
|
||||
EventProfile(damus_state: test_damus_state(), pubkey: test_note.pubkey, profile: nil, size: .normal)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,11 +133,11 @@ struct EventShell_Previews: PreviewProvider {
|
||||
|
||||
static var previews: some View {
|
||||
VStack {
|
||||
EventShell(state: test_damus_state(), event: test_event, options: [.no_action_bar]) {
|
||||
EventShell(state: test_damus_state(), event: test_note, options: [.no_action_bar]) {
|
||||
Text(verbatim: "Hello")
|
||||
}
|
||||
|
||||
EventShell(state: test_damus_state(), event: test_event, options: [.no_action_bar, .wide]) {
|
||||
EventShell(state: test_damus_state(), event: test_note, options: [.no_action_bar, .wide]) {
|
||||
Text(verbatim: "Hello")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ struct MutedEventView_Previews: PreviewProvider {
|
||||
|
||||
static var previews: some View {
|
||||
|
||||
MutedEventView(damus_state: test_damus_state(), event: test_event, selected: false)
|
||||
MutedEventView(damus_state: test_damus_state(), event: test_note, selected: false)
|
||||
.frame(width: .infinity, height: 50)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,6 +86,6 @@ struct SelectedEventView: View {
|
||||
|
||||
struct SelectedEventView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
SelectedEventView(damus: test_damus_state(), event: test_event, size: .selected)
|
||||
SelectedEventView(damus: test_damus_state(), event: test_note, size: .selected)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,10 +75,10 @@ func event_is_anonymous(ev: NostrEvent) -> Bool {
|
||||
struct TextEvent_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
VStack(spacing: 20) {
|
||||
TextEvent(damus: test_damus_state(), event: test_event, pubkey: "pk", options: [])
|
||||
TextEvent(damus: test_damus_state(), event: test_note, pubkey: test_pubkey, options: [])
|
||||
.frame(height: 400)
|
||||
|
||||
TextEvent(damus: test_damus_state(), event: test_event, pubkey: "pk", options: [.wide])
|
||||
TextEvent(damus: test_damus_state(), event: test_note, pubkey: test_pubkey, options: [.wide])
|
||||
.frame(height: 400)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,6 @@ struct WideEventView: View {
|
||||
|
||||
struct WideEventView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
WideEventView(event: test_event)
|
||||
WideEventView(event: test_note)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,6 +68,6 @@ func get_mutelist_users(_ mlist: NostrEvent?) -> [String] {
|
||||
|
||||
struct MutelistView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
MutelistView(damus_state: test_damus_state(), users: [test_event.pubkey, test_event.pubkey+"hi"])
|
||||
MutelistView(damus_state: test_damus_state(), users: [test_note.pubkey, test_note.pubkey])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -601,7 +601,7 @@ struct NoteContentView_Previews: PreviewProvider {
|
||||
let state = test_damus_state()
|
||||
|
||||
VStack {
|
||||
NoteContentView(damus_state: state, event: test_event, show_images: true, size: .normal, options: [])
|
||||
NoteContentView(damus_state: state, event: test_note, show_images: true, size: .normal, options: [])
|
||||
|
||||
NoteContentView(damus_state: state, event: test_longform_event.event, show_images: true, size: .normal, options: [.wide])
|
||||
.border(Color.red)
|
||||
|
||||
@@ -261,11 +261,11 @@ struct EventGroupView: View {
|
||||
struct EventGroupView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
VStack {
|
||||
EventGroupView(state: test_damus_state(), event: test_event, group: .repost(test_event_group))
|
||||
EventGroupView(state: test_damus_state(), event: test_note, group: .repost(test_event_group))
|
||||
.frame(height: 200)
|
||||
.padding()
|
||||
|
||||
EventGroupView(state: test_damus_state(), event: test_event, group: .reaction(test_event_group))
|
||||
EventGroupView(state: test_damus_state(), event: test_note, group: .reaction(test_event_group))
|
||||
.frame(height: 200)
|
||||
.padding()
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ struct NotificationItemView: View {
|
||||
}
|
||||
}
|
||||
|
||||
let test_notification_item: NotificationItem = .repost("evid", test_event_group)
|
||||
let test_notification_item: NotificationItem = .repost(test_note.id, test_event_group)
|
||||
|
||||
struct NotificationItemView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
|
||||
@@ -25,6 +25,7 @@ struct ProfilePicturesView: View {
|
||||
|
||||
struct ProfilePicturesView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ProfilePicturesView(state: test_damus_state(), pubkeys: ["a", "b"])
|
||||
let pubkey = test_note.pubkey
|
||||
ProfilePicturesView(state: test_damus_state(), pubkeys: [pubkey, pubkey])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,6 +106,6 @@ struct EventProfileName: View {
|
||||
|
||||
struct EventProfileName_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
EventProfileName(pubkey: "pk", profile: nil, damus: test_damus_state())
|
||||
EventProfileName(pubkey: test_note.pubkey, profile: nil, damus: test_damus_state())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,9 +54,9 @@ struct ProfileNameView: View {
|
||||
struct ProfileNameView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
VStack {
|
||||
ProfileNameView(pubkey: test_event.pubkey, profile: nil, follows_you: true, damus: test_damus_state())
|
||||
|
||||
ProfileNameView(pubkey: test_event.pubkey, profile: nil, follows_you: false, damus: test_damus_state())
|
||||
ProfileNameView(pubkey: test_note.pubkey, profile: nil, follows_you: true, damus: test_damus_state())
|
||||
|
||||
ProfileNameView(pubkey: test_note.pubkey, profile: nil, follows_you: false, damus: test_damus_state())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,19 +106,19 @@ func get_profile_url(picture: String?, pubkey: String, profiles: Profiles) -> UR
|
||||
return URL(string: robohash(pubkey))!
|
||||
}
|
||||
|
||||
func make_preview_profiles(_ pubkey: String) -> Profiles {
|
||||
func make_preview_profiles(_ pubkey: Pubkey) -> Profiles {
|
||||
let user_search_cache = UserSearchCache()
|
||||
let profiles = Profiles(user_search_cache: user_search_cache)
|
||||
let picture = "http://cdn.jb55.com/img/red-me.jpg"
|
||||
let profile = Profile(name: "jb55", display_name: "William Casarin", about: "It's me", picture: picture, banner: "", website: "https://jb55.com", lud06: nil, lud16: nil, nip05: "jb55.com", damus_donation: nil)
|
||||
let ts_profile = TimestampedProfile(profile: profile, timestamp: 0, event: test_event)
|
||||
let ts_profile = TimestampedProfile(profile: profile, timestamp: 0, event: test_note)
|
||||
profiles.add(id: pubkey, profile: ts_profile)
|
||||
return profiles
|
||||
}
|
||||
|
||||
struct ProfilePicView_Previews: PreviewProvider {
|
||||
static let pubkey = "ca48854ac6555fed8e439ebb4fa2d928410e0eef13fa41164ec45aaaa132d846"
|
||||
|
||||
static let pubkey = test_note.pubkey
|
||||
|
||||
static var previews: some View {
|
||||
ProfilePicView(
|
||||
pubkey: pubkey,
|
||||
|
||||
@@ -297,7 +297,7 @@ struct QRCodeView: View {
|
||||
|
||||
struct QRCodeView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
QRCodeView(damus_state: test_damus_state(), pubkey: test_event.pubkey)
|
||||
QRCodeView(damus_state: test_damus_state(), pubkey: test_note.pubkey)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,6 @@ struct ReactionsView: View {
|
||||
struct ReactionsView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
let state = test_damus_state()
|
||||
ReactionsView(damus_state: state, model: ReactionsModel(state: state, target: "pubkey"))
|
||||
ReactionsView(damus_state: state, model: ReactionsModel(state: state, target: test_note.id))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ struct ReplyView: View {
|
||||
struct ReplyView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
VStack {
|
||||
ReplyView(replying_to: test_event, damus: test_damus_state(), originalReferences: .constant([]), references: .constant([]))
|
||||
ReplyView(replying_to: test_note, damus: test_damus_state(), originalReferences: .constant([]), references: .constant([]))
|
||||
.frame(height: 300)
|
||||
|
||||
ReplyView(replying_to: test_longform_event.event, damus: test_damus_state(), originalReferences: .constant([]), references: .constant([]))
|
||||
|
||||
@@ -31,6 +31,6 @@ struct RepostedEvent: View {
|
||||
|
||||
struct RepostedEvent_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
RepostedEvent(damus: test_damus_state(), event: test_event, inner_ev: test_event, options: [])
|
||||
RepostedEvent(damus: test_damus_state(), event: test_note, inner_ev: test_note, options: [])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,6 @@ struct RepostsView: View {
|
||||
struct RepostsView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
let state = test_damus_state()
|
||||
RepostsView(damus_state: state, model: RepostsModel(state: state, target: "pubkey"))
|
||||
RepostsView(damus_state: state, model: RepostsModel(state: state, target: test_note.id))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,6 +125,6 @@ struct SearchingEventView: View {
|
||||
struct SearchingEventView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
let state = test_damus_state()
|
||||
SearchingEventView(state: state, evid: test_event.id, search_type: .event)
|
||||
SearchingEventView(state: state, evid: test_note.id, search_type: .event)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ struct ThreadView: View {
|
||||
struct ThreadView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
let state = test_damus_state()
|
||||
let thread = ThreadModel(event: test_event, damus_state: state)
|
||||
let thread = ThreadModel(event: test_note, damus_state: state)
|
||||
ThreadView(state: state, thread: thread)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,7 +302,7 @@ extension View {
|
||||
|
||||
struct CustomizeZapView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
CustomizeZapView(state: test_damus_state(), target: ZapTarget.note(id: test_event.id, author: test_event.pubkey), lnurl: "")
|
||||
CustomizeZapView(state: test_damus_state(), target: ZapTarget.note(id: test_note.id, author: test_note.pubkey), lnurl: "")
|
||||
.frame(width: 400, height: 600)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user