feat: Add Alpine to assets

This commit is contained in:
Robert Prehn 2021-03-01 15:53:31 -06:00
parent d562855024
commit be58824bd3
4 changed files with 17 additions and 1 deletions

View file

@ -13,6 +13,7 @@ import "../css/app.css"
// import socket from "./socket"
//
import "phoenix_html"
import "alpinejs"
import { ready } from "./utils"
function togglePasswordFieldVisibility()

View file

@ -1332,6 +1332,11 @@
"integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=",
"dev": true
},
"alpinejs": {
"version": "2.8.1",
"resolved": "https://registry.npmjs.org/alpinejs/-/alpinejs-2.8.1.tgz",
"integrity": "sha512-ETJ/k0fbiBeP+OSd5Fhj70c+zb+YRzcVbyh5DVeLT3FBWMUeUvjOSWLi53IVLPSehaT2SKmB7w08WGF2jYTqNA=="
},
"amdefine": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",

View file

@ -9,6 +9,7 @@
},
"dependencies": {
"@fortawesome/fontawesome-free": "^5.14.0",
"alpinejs": "^2.8.1",
"autoprefixer": "^9.8.6",
"csswring": "^7.0.0",
"glob": "^7.1.6",

View file

@ -27,4 +27,13 @@ defmodule AuthWeb.Plugs.RequireAdminTest do
assert !conn.halted
end
test "call/2 with a user who is not admin", %{conn: conn} do
conn =
conn
|> Pow.Plug.assign_current_user(%User{roles: []}, [])
|> RequireAdmin.call([])
assert conn.halted
end
end