mirror of
https://github.com/plausible/analytics.git
synced 2024-12-24 18:12:44 +03:00
e3af1a317d
* Migration: add installation meta * Update site schema with installation meta * Remove VERIFICATION_ENABLED env var * Add context API to create/remove special goals * Add context api to update installation meta * Remove verification enabled check * Update new progress flow definitions * Update generic components * Remove internal /status API * Implement installation live view * Update traffic change notifier link * Update verification, no more modal * Update routes * Remove focus.html - will unify everything under app layout * Fix broken link * Update templates with focus_box mostly * Update controller tests * Update controllers and stop using the focus layout * copy changes * Update verification.ex * Remove dead template * Update settings_general.html.heex * Update copy in tests * Update installation.ex * Remove dangling dot * Fix link * Update installation.ex * Update installation.ex * Better tooltips? * Simpler labels * Revert "Simpler labels" This reverts commit 797560ef82f2067458b03b884be5aecc8fdc72bc. * Add copy to clipboard link and fix snippet's dark mode * Offer installation detection skip only if ws connected * Put COPY link at the bottom with background * Make tooltips link to docs * Fix cherry-pick gone wrong * Hide tooltips on mobile screens * WIP: 404 tracking wizard * Revert "WIP: 404 tracking wizard" This reverts commita9c9c79bbd
. * Update lib/plausible_web/live/components/verification.ex Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com> * Update lib/plausible_web/live/installation.ex Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com> * Use current_user from socket.assigns * Update lib/plausible_web/live/installation.ex Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com> * Use current_user from socket.assigns * Use conn.private to steer verification tests * Drop non-sticky tooltip in favour of component parametrization Co-authored-by: Artur Pata <artur.pata@gmail.com> * Reapply "WIP: 404 tracking wizard" This reverts commit3ba81671d7
. * Fix installation tests including 404 tracking * Fixup the tooltip component * Format * Update installation.ex * Put flash whenever installation option changes * Use last known installation type on domain change * Extract user flow definition to provide compile-time checks * See if this helps running CE migrations successfully * Use `styled_link` on registration/login views * Don't crash when there's no conn.private carried over * Format * Push "Determining installation type" message a bit lower * Use links and footer lists uniformly This commit introduces a `<.focus_list/>` component for rendering focus box footer links with colored discs. It also equips generic link components with the ability of sending non-GET requests along with CSRF token, so we can apply uniform styling and stop using legacy Phoenix link tags. cc @zoldar @apata * ws 👾 * Render more descriptive flashes on script config change --------- Co-authored-by: Marko Saric <34340819+metmarkosaric@users.noreply.github.com> Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com> Co-authored-by: Artur Pata <artur.pata@gmail.com>
82 lines
2.1 KiB
Elixir
82 lines
2.1 KiB
Elixir
defmodule PlausibleWeb.Components.FlowProgressTest do
|
|
use Plausible.DataCase
|
|
|
|
import Plausible.LiveViewTest, only: [render_component: 2]
|
|
import Plausible.Test.Support.HTML
|
|
|
|
alias PlausibleWeb.Components.FlowProgress
|
|
|
|
test "no flow or unknown flow renders nothing" do
|
|
rendered =
|
|
render_component(&FlowProgress.render/1,
|
|
flow: nil,
|
|
current_step: "unhandled"
|
|
)
|
|
|
|
assert rendered == ""
|
|
|
|
rendered =
|
|
render_component(&FlowProgress.render/1,
|
|
flow: "unhandled",
|
|
current_step: "unhandled"
|
|
)
|
|
|
|
assert rendered == ""
|
|
end
|
|
|
|
test "register" do
|
|
rendered =
|
|
render_component(&FlowProgress.render/1,
|
|
flow: PlausibleWeb.Flows.register(),
|
|
current_step: "Register"
|
|
)
|
|
|
|
assert text_of_element(rendered, "#flow-progress") ==
|
|
"1 Register 2 Activate account 3 Add site info 4 Install Plausible 5 Verify installation"
|
|
end
|
|
|
|
test "invitation" do
|
|
rendered =
|
|
render_component(&FlowProgress.render/1,
|
|
flow: PlausibleWeb.Flows.invitation(),
|
|
current_step: "Register"
|
|
)
|
|
|
|
assert text_of_element(rendered, "#flow-progress") ==
|
|
"1 Register 2 Activate account"
|
|
end
|
|
|
|
test "provisioning" do
|
|
rendered =
|
|
render_component(&FlowProgress.render/1,
|
|
flow: PlausibleWeb.Flows.provisioning(),
|
|
current_step: "Add site info"
|
|
)
|
|
|
|
assert text_of_element(rendered, "#flow-progress") ==
|
|
"1 Add site info 2 Install Plausible 3 Verify installation"
|
|
end
|
|
|
|
test "review" do
|
|
rendered =
|
|
render_component(&FlowProgress.render/1,
|
|
flow: PlausibleWeb.Flows.review(),
|
|
current_step: "Install Plausible"
|
|
)
|
|
|
|
assert text_of_element(rendered, "#flow-progress") ==
|
|
"1 Install Plausible 2 Verify installation"
|
|
end
|
|
|
|
test "domain_change" do
|
|
rendered =
|
|
render_component(&FlowProgress.render/1,
|
|
flow: PlausibleWeb.Flows.domain_change(),
|
|
current_step: "Set up new domain"
|
|
)
|
|
|
|
assert text_of_element(rendered, "#flow-progress") ==
|
|
"1 Set up new domain 2 Install Plausible 3 Verify installation"
|
|
end
|
|
end
|