eclark

eclark

Heyya is a library to help with testing your Phoenix components. It allows for writing fast tests that assert your HTML is consistent and correct. Specifically, Heyya is designed to work with many functional components and the latest Phoenix and LiveView releases. As your code changes and mutates, tests can change quickly without writing new assertions each time.

https://github.com/batteries-included/heyya

There’s a blog post up with example code and integration help here:

https://www.batteriesincl.com/posts/heyya-snapshot-testing

Hex Docs are here:

If you’ve ever used React snapshot testing, Heyya will feel very similar.

First Post! Switch mode

eclark

eclark OP

We are releasing Heyya 1.0.0 which includes the following:

  • Stateless component snapshot testing
  • Easier to use LiveView pipe-based view testing
  • LiveComponent testing with automatic view hosting
  • LiveView snapshot testing

When combined, these tools allow for fast testing of Phoenix UIs that are easy to maintain and easy to read.

Blog Post: https://www.batteriesincl.com/posts/heyya-one-point-zero
Github: https://github.com/batteries-included/heyya
Docs: https://hexdocs.pm/heyya/readme.html

The newest LiveView snapshot testing feature allows developers to interact with a Phoenix live view and easily assert that some portion of the DOM matches the previous expectations.

For example, here’s an excerpt taken from the example project

defmodule ExampleWeb.NumbersLiveTest do
  use Heyya.LiveCase
  use ExampleWeb.ConnCase

  test "/numbers renders the live_view", %{conn: conn} do
    conn
    |> start(~p"/numbers")
    |> assert_matches_snapshot(name: "full_view", selector: "main")
  end
end
— All posts loaded —

Where Next? Top

Trending in Announcing Top

bluzky
You may know https://ui.shadcn.com/, a UI component library for React. I really love it’s design style and components. I’ve built some co...
387 15136 120
New
woylie
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries. offset-based pagination with...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
shahryarjb
The Chelekom project is a library of Phoenix and LiveView components generated via Mix tasks to fit developer needs seamlessly. One of i...
New
woylie
Phoenix components for pagination, sortable tables and filter forms with Flop and (optionally) Ecto. pagination cursor pagination sorta...
New
kip
Please say hi to a new lib, Astro that aims to deliver easy-to-consume astronomy calculations of practical use. For now it only calculat...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

Other Trending Topics Top

juhalehtonen
There has been a thread to discuss the Stack Overflow Developer Survey on this forum every year since 2018, so here’s yet another one for...
New
type1fool
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
New
akoutmos
@hugobarauna and I (Alex Koutmos) have been hard at work on writing a book on Nerves that takes you from simply blinking LEDs to building...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
alexslade
Fly’s CEO posted this recently - Turn And Face The Strange · The Fly Blog It says that Fly is going all-in on sprites, which is a worry ...
New
bartblast
Hey folks, I just published a post about Hologram’s funding and where the project goes next - the short version: Curiosum as Main Spons...
New

We're in Beta

About us Mission Statement