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 { render, screen, waitFor } from '@testing-library/react'; | |
import userEvent from '@testing-library/user-event'; | |
import formTestConstants from '../../constants/formTest.constants'; | |
import { CompanyForm } from '../../components/forms/CompanyForm/CompanyForm'; | |
// testing if company form is working | |
describe('CompanyForm tests 🙂', () => { | |
it('Success test', async () => { |
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 { render, screen, waitFor } from '@testing-library/react'; | |
import userEvent from '@testing-library/user-event'; | |
import formTestConstants from '../../constants/formTest.constants'; | |
import { CompanyForm } from '../../components/forms/CompanyForm/CompanyForm'; |
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
it('Failure test', async () => { | |
const handleSubmit = jest.fn(); | |
render(<CompanyForm onSubmit={handleSubmit} />); | |
const submitButton = screen.getByTestId('companyFormSubmitButton'); | |
const nameError = screen.getByTestId('nameError'); | |
const emailError = screen.queryByTestId('emailError'); | |
const phoneNumberError = screen.queryByTestId('phoneNumberError'); | |
const agreementError = screen.queryByTestId('agreementError'); |
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
module.exports = { | |
i18n: { | |
locales: ['us', 'am'], | |
defaultLocale: 'us', | |
}, | |
}; |
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 Link from 'next/link'; | |
import { useRouter } from 'next/dist/client/router'; | |
export default function Test() { | |
const { locales, asPath } = useRouter(); | |
return ( | |
<div> | |
{locales.map((localeName) => { | |
return ( |
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 { MDXRemote } from 'next-mdx-remote'; | |
import getDocBySlug from '../src/services/getDocBySlug.mjs'; | |
import Image from 'next/image'; | |
import { serialize } from 'next-mdx-remote/serialize'; | |
export default function Blog({ content, meta }) { | |
const components = { | |
Image, | |
}; |
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 matter from 'gray-matter'; | |
import path from 'path'; | |
import fs from 'fs'; | |
export default function getDocBySlug(slug, locale = 'us') { | |
const docsDirectory = path.join(process.cwd(), '/src/content'); | |
const realSlug = slug.replace(/\.mdx$/, ''); | |
const fullPath = path.join(docsDirectory, slug, `${realSlug}.${locale}.mdx`); | |
const fileContents = fs.readFileSync(fullPath, 'utf8'); | |
const { content, data } = matter(fileContents); |
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 { Octokit } from '@octokit/rest'; | |
export const octokit = new Octokit({ | |
auth: process.env.NEXT_PUBLIC_GITHUB_TOKEN, | |
}); | |
export const octokitResponse = async (responseUrl, dataToSend) => { | |
const responseData = await fetch(responseUrl, { | |
body: JSON.stringify(dataToSend), | |
method: 'POST', |
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
/* eslint-disable */ | |
import path from 'path'; | |
import { Languages } from '../../constants'; | |
import { popupMessages } from '../../constants/popup-messages.constants'; | |
import { popupVariants } from '../../constants/popup.constants'; | |
import { getUserNameFromEmail } from '../../helpers/string.helpers'; | |
import { octokit } from '../../services/admin.services'; | |
import { GithubOrganization } from './constants/github.constants'; |
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
/* eslint-disable */ | |
import { Octokit } from '@octokit/rest'; | |
import { popupMessages } from '../../constants/popup-messages.constants'; | |
import { popupVariants } from '../../constants/popup.constants'; | |
import { getUserNameFromEmail } from '../../helpers/string.helpers'; | |
import { | |
GithubOrganization, | |
successStatusCodes, | |
} from './constants/github.constants'; |
OlderNewer