Skip to content

Commit

Permalink
test: adding search suggestions preview card snapshot test
Browse files Browse the repository at this point in the history
  • Loading branch information
BRonen committed Jun 18, 2023
1 parent 6b086f0 commit 0723b2e
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/Components/SearchSuggestionsDisplay_test.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
open Vitest
open Setup
open Utils
open ReactTestingLibrary
open ReactTestRenderer
open JsDom
open GithubService

describe("Search suggestion preview card component", _ => {
test("should match component snapshot", t => {
t->assertions(1)

let item = {
login: "johnny",
avatarUrl: "#avatarUrl",
}

create(<SearchSuggestionsDisplay.UserPreview item />)->expect->toMatchSnapshot
})
})
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Search suggestion preview card component > should match component snapshot 1`] = `
<a
onClick={[Function]}
>
<div
className="flex flex-row items-center gap-3 h-40 p-3 bg-gray-100 shadow-md cursor-pointer hover:scale-[1.02] transition-transform"
>
<img
alt="Profile picture"
className="rounded-lg border shadow-lg h-32"
src="#avatarUrl"
/>
<h2
className="text-2xl text-[#4c4f69] "
>
johnny
</h2>
</div>
</a>
`;

1 comment on commit 0723b2e

@vercel
Copy link

@vercel vercel bot commented on 0723b2e Jun 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.