This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { screen, render, fireEvent } from "@testing-library/react"; | |
import InputField from "./InputField"; | |
import { Formik } from "formik"; | |
test("should have validation error given input field is touched and error exists on form", () => { | |
const fieldName = "firstName"; | |
const labelName = "First Name"; | |
render( | |
<Formik |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { Field } from "formik"; | |
const InputField = (props) => { | |
return ( | |
<Field name={props.fieldName}> | |
{({ field, form }) => ( | |
<div> | |
<label htmlFor={props.fieldName}>{props.labelName}</label> | |
<input {...field} id={props.fieldName} type="text" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace RazorHtmlEmails.RazorClassLib.Views.Emails.ConfirmAccount; | |
public record ConfirmAccountEmailViewModel(string ConfirmEmailUrl); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
builder.Services.AddScoped<IRegisterAccountService, RegisterAccountService>(); | |
builder.Services.AddScoped<IRazorViewToStringRenderer, RazorViewToStringRenderer>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MailKit.Net.Smtp; | |
using MimeKit; | |
using MimeKit.Text; | |
using RazorHtmlEmails.RazorClassLib.Services; | |
using RazorHtmlEmails.RazorClassLib.Views.Emails.ConfirmAccount; | |
using System; | |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
namespace RazorHtmlEmails.Common; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Http; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.Abstractions; | |
using Microsoft.AspNetCore.Mvc.ModelBinding; | |
using Microsoft.AspNetCore.Mvc.Razor; | |
using Microsoft.AspNetCore.Mvc.Rendering; | |
using Microsoft.AspNetCore.Mvc.ViewEngines; | |
using Microsoft.AspNetCore.Mvc.ViewFeatures; | |
using Microsoft.AspNetCore.Routing; | |
using System; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.RazorPages; | |
using RazorHtmlEmails.Common; | |
namespace RazorHtmlEmails.AspNetCore.Pages; | |
public class IndexModel : PageModel | |
{ | |
private readonly IRegisterAccountService _registerAccountService; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
result.Should().Be(2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Assert.Equal(2, result); |