Fix cljs tests

Now testing for invalid config and auth.
Bumped dependency for c4k-common-cljs.
This commit is contained in:
erik 2023-01-31 11:58:44 +01:00
parent c7560de0db
commit 2b28a02e17
3 changed files with 6 additions and 4 deletions

View file

@ -4,7 +4,7 @@
"src/test/cljc" "src/test/cljc"
"src/test/cljs" "src/test/cljs"
"src/test/resources"] "src/test/resources"]
:dependencies [[org.domaindrivenarchitecture/c4k-common-cljs "5.0.1"] :dependencies [[org.domaindrivenarchitecture/c4k-common-cljs "6.0.1"]
[hickory "0.7.1"]] [hickory "0.7.1"]]
:builds {:frontend {:target :browser :builds {:frontend {:target :browser
:modules {:main {:init-fn dda.c4k-keycloak.browser/init}} :modules {:main {:init-fn dda.c4k-keycloak.browser/init}}

View file

@ -12,10 +12,12 @@
(case resource-name (case resource-name
"keycloak-test/valid-auth.yaml" (rc/inline "keycloak-test/valid-auth.yaml") "keycloak-test/valid-auth.yaml" (rc/inline "keycloak-test/valid-auth.yaml")
"keycloak-test/valid-config.yaml" (rc/inline "keycloak-test/valid-config.yaml") "keycloak-test/valid-config.yaml" (rc/inline "keycloak-test/valid-config.yaml")
"keycloak-test/invalid-config.yaml" (rc/inline "keycloak-test/invalid-config.yaml")
"keycloak-test/invalid-auth.yaml" (rc/inline "keycloak-test/invalid-auth.yaml")
(throw (js/Error. "Undefined Resource!"))))) (throw (js/Error. "Undefined Resource!")))))
(deftest validate-valid-resources (deftest validate-valid-resources
(is (s/valid? cut/config? (yaml/load-as-edn "keycloak-test/valid-config.yaml"))) (is (s/valid? cut/config? (yaml/load-as-edn "keycloak-test/valid-config.yaml")))
(is (s/valid? cut/auth? (yaml/load-as-edn "keycloak-test/valid-auth.yaml"))) (is (s/valid? cut/auth? (yaml/load-as-edn "keycloak-test/valid-auth.yaml")))
(is (not (s/valid? cut/config? (yaml/load-as-edn "keycloak-test/invalid-config.yaml")))) (is (not (s/valid? cut/config? (yaml/load-as-edn "keycloak-test/invalid-config.yaml"))))
(is (not (s/valid? cut/config? (yaml/load-as-edn "keycloak-test/invalid-auth.yaml"))))) (is (not (s/valid? cut/auth? (yaml/load-as-edn "keycloak-test/invalid-auth.yaml")))))

View file

@ -1,7 +1,7 @@
keyclok-admin-user: "testuser" keycloak-admin-user: "testuser"
keycloak-admin-password: "testpassword" keycloak-admin-password: "testpassword"
postgres-db-user: "keycloakuser" postgres-db-user: "keycloakuser"
postgres-db-password: "testdbpassword" postgres-db-password: "testdbpassword"
mon-auth: mon-auth:
grafana-cloud-user: "user" grafana-clod-user: "user"
grafana-cloud-password: "password" grafana-cloud-password: "password"