Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: file movement for two fa attempts inside dashboard #1556

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions cypress/e2e/connector/connector.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,14 @@ describe("connector", () => {
it("Create a dummy connector", () => {
cy.url().should("include", "/dashboard/home");

cy.get('[data-form-label="Business name"]').should(
"exist",
);
cy.get("[data-testid=merchant_name]").type(
"test_business",
);
cy.get('[data-form-label="Business name"]').should("exist");
cy.get("[data-testid=merchant_name]").type("test_business");
cy.get("[data-button-for=startExploring]").click();
cy.reload(true);
cy.get("[data-testid=connectors]").click();
cy.get("[data-testid=paymentprocessors]").click();
cy.contains("Payment Processors").should("be.visible");
cy.contains("Connect a Dummy Processor").should(
"be.visible",
);
cy.contains("Connect a Dummy Processor").should("be.visible");
cy.get("[data-button-for=connectNow]").click({
force: true,
});
Expand All @@ -52,9 +46,7 @@ describe("connector", () => {
.find("button")
.should("have.length", 4);
cy.contains("Stripe Dummy").should("be.visible");
cy.get('[data-testid="stripe_test"]')
.find("button")
.click({ force: true });
cy.get('[data-testid="stripe_test"]').find("button").click({ force: true });
cy.url().should("include", "/dashboard/connectors");
cy.contains("Credentials").should("be.visible");
cy.get("[name=connector_account_details\\.api_key]")
Expand Down
76 changes: 38 additions & 38 deletions src/entryPoints/AuthModule/Common/CommonAuth.res
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
module TermsAndCondition = {
@react.component
let make = () => {
<AddDataAttributes attributes=[("data-testid", "tc-text")]>
<div id="tc-text" className="text-center text-sm text-gray-300">
{"By continuing, you agree to our "->React.string}
<a
className="underline cursor-pointer"
href="https://hyperswitch.io/terms-of-services"
target="__blank">
{"Terms of Service"->React.string}
</a>
{" & "->React.string}
<a
className="underline cursor-pointer"
href="https://hyperswitch.io/privacyPolicy"
target="__blank">
{"Privacy Policy"->React.string}
</a>
</div>
</AddDataAttributes>
<AddDataAttributes attributes=[("data-testid", "tc-text")]>
<div id="tc-text" className="text-center text-sm text-gray-300">
{"By continuing, you agree to our "->React.string}
<a
className="underline cursor-pointer"
href="https://hyperswitch.io/terms-of-services"
target="__blank">
{"Terms of Service"->React.string}
</a>
{" & "->React.string}
<a
className="underline cursor-pointer"
href="https://hyperswitch.io/privacyPolicy"
target="__blank">
{"Privacy Policy"->React.string}
</a>
</div>
</AddDataAttributes>
}
}

Expand All @@ -28,12 +28,12 @@ module PageFooterSection = {
<div
className="justify-center text-base flex flex-col md:flex-row md:gap-3 items-center py-5 md:py-7">
<AddDataAttributes attributes=[("data-testid", "footer")]>
<div id="footer" className="flex items-center gap-2">
{"An open-source initiative by "->React.string}
<a href="https://juspay.in/" target="__blank">
<img alt="juspay-logo" src={`/icons/juspay-logo-dark.svg`} className="h-3" />
</a>
</div>
<div id="footer" className="flex items-center gap-2">
{"An open-source initiative by "->React.string}
<a href="https://juspay.in/" target="__blank">
<img alt="juspay-logo" src={`/icons/juspay-logo-dark.svg`} className="h-3" />
</a>
</div>
</AddDataAttributes>
</div>
}
Expand Down Expand Up @@ -82,17 +82,17 @@ module Header = {
<div className="flex text-sm items-center gap-2">
<div className="text-grey-650"> {prefix->React.string} </div>
<AddDataAttributes attributes=[("data-testid", "card-subtitle")]>
<div
onClick={_ => {
form.resetFieldState("email")
form.reset(JSON.Encode.object(Dict.make())->Nullable.make)
setAuthType(_ => authType)
GlobalVars.appendDashboardPath(~url=path)->RescriptReactRouter.push
}}
id="card-subtitle"
className={`font-semibold ${textColor.primaryNormal} cursor-pointer`}>
{sufix->React.string}
</div>
<div
onClick={_ => {
form.resetFieldState("email")
form.reset(JSON.Encode.object(Dict.make())->Nullable.make)
setAuthType(_ => authType)
GlobalVars.appendDashboardPath(~url=path)->RescriptReactRouter.push
}}
id="card-subtitle"
className={`font-semibold ${textColor.primaryNormal} cursor-pointer`}>
{sufix->React.string}
</div>
</AddDataAttributes>
</div>
}
Expand All @@ -119,9 +119,9 @@ module Header = {
</div>
</RenderIf>
<AddDataAttributes attributes=[("data-testid", "card-header")]>
<h1 id="card-header" className="font-semibold text-xl md:text-2xl">
{cardHeaderText->React.string}
</h1>
<h1 id="card-header" className="font-semibold text-xl md:text-2xl">
{cardHeaderText->React.string}
</h1>
</AddDataAttributes>
{switch authType {
| LoginWithPassword | LoginWithEmail =>
Expand Down
36 changes: 18 additions & 18 deletions src/entryPoints/AuthModule/TwoFaAuth/TwoFaAuth.res
Original file line number Diff line number Diff line change
Expand Up @@ -292,24 +292,24 @@ let make = (~setAuthStatus, ~authType, ~setAuthType) => {
| _ => React.null
}}
<AddDataAttributes attributes=[("data-testid", "auth-submit-btn")]>
<div id="auth-submit-btn" className="flex flex-col gap-2">
{switch authType {
| LoginWithPassword
| LoginWithEmail
| ResetPassword
| ForgetPassword
| ResendVerifyEmail
| SignUP =>
<FormRenderer.SubmitButton
customSumbitButtonStyle="!w-full !rounded"
text=submitBtnText
userInteractionRequired=true
showToolTip=false
loadingText="Loading..."
/>
| _ => React.null
}}
</div>
<div id="auth-submit-btn" className="flex flex-col gap-2">
{switch authType {
| LoginWithPassword
| LoginWithEmail
| ResetPassword
| ForgetPassword
| ResendVerifyEmail
| SignUP =>
<FormRenderer.SubmitButton
customSumbitButtonStyle="!w-full !rounded"
text=submitBtnText
userInteractionRequired=true
showToolTip=false
loadingText="Loading..."
/>
| _ => React.null
}}
</div>
</AddDataAttributes>
<AddDataAttributes attributes=[("data-testid", "card-foot-text")]>
<div> {note} </div>
Expand Down
Loading
Loading