Skip to content

Commit

Permalink
Implement tests for FeedSpecs
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmedalijaK committed Dec 12, 2024
1 parent d8b5216 commit ed58401
Showing 1 changed file with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,40 @@ class FeedExtensionsKtTest {
spec.isNotesBookmarkFeedSpec() shouldBe false
}

@Test
fun isNotesFeedSpec_forProperFeedSpec_returnsTrue() {
val specId = "{\"id\":\"advsearch\",\"query\":\"kind:1 mehmedalija pas:1\"}"
val specText = "{\"id\":\"latest\",\"kind\":\"notes\"}"
specId.isNotesFeedSpec() shouldBe true
specText.isNotesFeedSpec() shouldBe true
}

@Test
fun isReadsFeedSpec_forProperFeedSpec_returnsTrue() {
val specId = "{\"id\":\"advsearch\",\"query\":\"kind:30023 code pas:1\"}"
val specText = "{\"id\":\"nostr-reads-feed\",\"kind\":\"reads\"}"
specId.isReadsFeedSpec() shouldBe true
specText.isReadsFeedSpec() shouldBe true
}

@Test
fun isImageFeedSpec_forProperFeedSpec_returnsTrue() {
val spec = "{\"id\":\"advsearch\",\"query\":\"filter:image waterfall pas:1\"}"
spec.isImageSpec() shouldBe true
}

@Test
fun isVideoFeedSpec_forProperFeedSpec_returnsTrue() {
val spec = "{\"id\":\"advsearch\",\"query\":\"filter:video running pas:1\"}"
spec.isVideoSpec() shouldBe true
}

@Test
fun isAudioFeedSpec_forProperFeedSpec_returnsTrue() {
val spec = "{\"id\":\"advsearch\",\"query\":\"filter:audio music pas:1\"}"
spec.isAudioSpec() shouldBe true
}

// @Test
// fun isReadsBookmarkFeedSpec_forProperFeedSpec_returnsTrue() {
// println(buildArticleBookmarksFeedSpec(userId = profileId))
Expand Down

0 comments on commit ed58401

Please sign in to comment.