mirror of
https://github.com/jambonz/jambonz-webapp.git
synced 2026-10-18 17:34:23 +00:00
* feat: update @jambonz/ui-kit:0.0.21 * fix security vulnerabilities --------- Co-authored-by: Quan HL <quanluuhoang8@gmail.com> Co-authored-by: Dave Horton <daveh@beachdognet.com>
36 lines
778 B
TypeScript
36 lines
778 B
TypeScript
import React from "react";
|
|
import { H1 } from "@jambonz/ui-kit";
|
|
|
|
import { RequireAuth } from "./require-auth";
|
|
|
|
/** Wrapper to pass different auth contexts */
|
|
const RequireAuthTestWrapper = () => {
|
|
return (
|
|
<RequireAuth>
|
|
<div className="auth-div">
|
|
<H1>Protected Route</H1>
|
|
</div>
|
|
</RequireAuth>
|
|
);
|
|
};
|
|
|
|
describe("<RequireAuth>", () => {
|
|
it("mounts", () => {
|
|
cy.mountTestProvider(<RequireAuthTestWrapper />);
|
|
});
|
|
|
|
it("is not authorized", () => {
|
|
cy.mountTestProvider(<RequireAuthTestWrapper />);
|
|
|
|
cy.get(".auth-div").should("not.exist");
|
|
});
|
|
|
|
it("is authorized", () => {
|
|
cy.mountTestProvider(<RequireAuthTestWrapper />, {
|
|
authProps: { authorized: true },
|
|
});
|
|
|
|
cy.get(".auth-div").should("exist");
|
|
});
|
|
});
|