Skip to content

Commit

Permalink
Merge pull request #11911 from qmonmert/renametest
Browse files Browse the repository at this point in the history
Rename some tests
  • Loading branch information
murdos authored Feb 15, 2025
2 parents a1e2bdf + 370737c commit b55c829
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public JHipsterModule buildModule(JHipsterModuleProperties properties) {
.in(path(INDEX_TEST + "webapp/unit/home/infrastructure/primary/HomePage.spec.tsx"))
.add(append(), LINE_BREAK + """
describe('Home I18next', () => {
it('renders with translation', () => {
it('should render with translation', () => {
vi.mock('react-i18next', () => ({
useTranslation: () => {
return {
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/generator/client/common/i18n/i18n.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import i18n from '@/i18n';
import { mergeTranslations, type Translations } from '@/Translations';

describe('i18n configuration', () => {
it('loads en translation', () => {
it('should load en translation', () => {
expect((i18n.getResourceBundle('en', '') as Translations).home.translationEnabled).toBe('Internationalization enabled');
});

it('loads fr translation', () => {
it('should load fr translation', () => {
expect((i18n.getResourceBundle('fr', '') as Translations).home.translationEnabled).toBe('Internationalisation activée');
});

describe('mergeTranslations function', () => {
it('merges translations correctly when keys overlap', () => {
it('should merge translations correctly when keys overlap', () => {
const translationSet1 = {
en: {
home: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { describe, it } from 'vitest';
import HomePage from '@/home/infrastructure/primary/HomePage';

describe('Home tests', () => {
it('renders without crashing', () => {
it('should render without crashing', () => {
const { getByText } = render(<HomePage />);
const title = getByText('React + TypeScript + Vite');
expect(title).toBeTruthy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ const login = async () => {
};

describe('loginForm', () => {
it('render button should contain "Log in"', () => {
it('should render button should contain "Log in"', () => {
const { getByText } = render(<LoginForm />);
const loginButton = getByText('Log in');
expect(loginButton).toBeTruthy();
});

it('render the modal on login button click and close it', async () => {
it('should render the modal on login button click and close it', async () => {
const { getByText, getByTestId } = render(<LoginForm />);
const loginButton = getByText('Log in');
fireEvent.click(loginButton);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('test login modal', () => {
expect(submit).toBeTruthy();
});

it('render the modal on login button click and close the modal on submit button click', async () => {
it('should render the modal on login button click and close the modal on submit button click', async () => {
const { getByPlaceholderText, getByTestId } = LoginModalRender(true);
const spy = vi.spyOn(axios, 'post');
spy.mockImplementationOnce((): Promise<any> => Promise.resolve({ data: {} }));
Expand All @@ -71,7 +71,7 @@ describe('test login modal', () => {
expect(spy).toHaveBeenCalledOnce();
});

it('render the modal on login button click and close the modal on close button', async () => {
it('should render the modal on login button click and close the modal on close button', async () => {
const { getByPlaceholderText, getByRole } = LoginModalRender(true);
const spy = vi.spyOn(axios, 'post');
spy.mockImplementationOnce((): Promise<any> => Promise.resolve({ data: {} }));
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/projects/react-app/HomePage.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { describe, it } from 'vitest';
import HomePage from '@/home/infrastructure/primary/HomePage';

describe('Home tests', () => {
it('renders without crashing', () => {
it('should render without crashing', () => {
const { getByText } = render(<HomePage />);
const title = getByText('React + TypeScript + Vite');
expect(title).toBeTruthy();
Expand Down

0 comments on commit b55c829

Please sign in to comment.