Files
tasknote/client/src/__test__/components/ContentHeader.test.tsx
T
rmcamposGitHubdependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>snyk-bot
64048dd5d3 Feat/improve security (#482)
* build(deps): bump org.hibernate.orm.tooling:hibernate-enhance-maven-plugin

Bumps [org.hibernate.orm.tooling:hibernate-enhance-maven-plugin](https://github.com/hibernate/hibernate-orm) from 6.6.15.Final to 6.6.16.Final.
- [Release notes](https://github.com/hibernate/hibernate-orm/releases)
- [Changelog](https://github.com/hibernate/hibernate-orm/blob/6.6.16/changelog.txt)
- [Commits](https://github.com/hibernate/hibernate-orm/compare/6.6.15...6.6.16)

---
updated-dependencies:
- dependency-name: org.hibernate.orm.tooling:hibernate-enhance-maven-plugin
  dependency-version: 6.6.16.Final
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump com.puppycrawl.tools:checkstyle in /server

Bumps [com.puppycrawl.tools:checkstyle](https://github.com/checkstyle/checkstyle) from 10.23.1 to 10.24.0.
- [Release notes](https://github.com/checkstyle/checkstyle/releases)
- [Commits](https://github.com/checkstyle/checkstyle/compare/checkstyle-10.23.1...checkstyle-10.24.0)

---
updated-dependencies:
- dependency-name: com.puppycrawl.tools:checkstyle
  dependency-version: 10.24.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump org.springframework.boot:spring-boot-starter-parent

Bumps [org.springframework.boot:spring-boot-starter-parent](https://github.com/spring-projects/spring-boot) from 3.4.1 to 3.5.0.
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](https://github.com/spring-projects/spring-boot/compare/v3.4.1...v3.5.0)

---
updated-dependencies:
- dependency-name: org.springframework.boot:spring-boot-starter-parent
  dependency-version: 3.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump @vitejs/plugin-react from 4.4.1 to 4.5.0 in /client

Bumps [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/tree/HEAD/packages/plugin-react) from 4.4.1 to 4.5.0.
- [Release notes](https://github.com/vitejs/vite-plugin-react/releases)
- [Changelog](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite-plugin-react/commits/plugin-react@4.5.0/packages/plugin-react)

---
updated-dependencies:
- dependency-name: "@vitejs/plugin-react"
  dependency-version: 4.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump react-router from 7.6.0 to 7.6.1 in /client

Bumps [react-router](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router) from 7.6.0 to 7.6.1.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router@7.6.1/packages/react-router)

---
updated-dependencies:
- dependency-name: react-router
  dependency-version: 7.6.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump react-datepicker from 8.3.0 to 8.4.0 in /client

Bumps [react-datepicker](https://github.com/Hacker0x01/react-datepicker) from 8.3.0 to 8.4.0.
- [Release notes](https://github.com/Hacker0x01/react-datepicker/releases)
- [Commits](https://github.com/Hacker0x01/react-datepicker/compare/v8.3.0...v8.4.0)

---
updated-dependencies:
- dependency-name: react-datepicker
  dependency-version: 8.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps-dev): bump @stylistic/eslint-plugin in /client

Bumps [@stylistic/eslint-plugin](https://github.com/eslint-stylistic/eslint-stylistic/tree/HEAD/packages/eslint-plugin) from 4.2.0 to 4.4.0.
- [Release notes](https://github.com/eslint-stylistic/eslint-stylistic/releases)
- [Changelog](https://github.com/eslint-stylistic/eslint-stylistic/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint-stylistic/eslint-stylistic/commits/v4.4.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@stylistic/eslint-plugin"
  dependency-version: 4.4.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps-dev): bump globals from 16.1.0 to 16.2.0 in /client

Bumps [globals](https://github.com/sindresorhus/globals) from 16.1.0 to 16.2.0.
- [Release notes](https://github.com/sindresorhus/globals/releases)
- [Commits](https://github.com/sindresorhus/globals/compare/v16.1.0...v16.2.0)

---
updated-dependencies:
- dependency-name: globals
  dependency-version: 16.2.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps-dev): bump jasmine-core from 5.6.0 to 5.7.1 in /angular

Bumps [jasmine-core](https://github.com/jasmine/jasmine) from 5.6.0 to 5.7.1.
- [Release notes](https://github.com/jasmine/jasmine/releases)
- [Changelog](https://github.com/jasmine/jasmine/blob/main/RELEASE.md)
- [Commits](https://github.com/jasmine/jasmine/compare/v5.6.0...v5.7.1)

---
updated-dependencies:
- dependency-name: jasmine-core
  dependency-version: 5.7.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps-dev): bump @angular/cli from 19.2.12 to 19.2.13 in /angular

Bumps [@angular/cli](https://github.com/angular/angular-cli) from 19.2.12 to 19.2.13.
- [Release notes](https://github.com/angular/angular-cli/releases)
- [Changelog](https://github.com/angular/angular-cli/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular-cli/compare/19.2.12...19.2.13)

---
updated-dependencies:
- dependency-name: "@angular/cli"
  dependency-version: 19.2.13
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump @angular/platform-browser-dynamic in /angular

Bumps [@angular/platform-browser-dynamic](https://github.com/angular/angular/tree/HEAD/packages/platform-browser-dynamic) from 19.2.10 to 19.2.13.
- [Release notes](https://github.com/angular/angular/releases)
- [Changelog](https://github.com/angular/angular/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular/commits/19.2.13/packages/platform-browser-dynamic)

---
updated-dependencies:
- dependency-name: "@angular/platform-browser-dynamic"
  dependency-version: 19.2.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump @angular/router from 19.2.10 to 19.2.13 in /angular

Bumps [@angular/router](https://github.com/angular/angular/tree/HEAD/packages/router) from 19.2.10 to 19.2.13.
- [Release notes](https://github.com/angular/angular/releases)
- [Changelog](https://github.com/angular/angular/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular/commits/19.2.13/packages/router)

---
updated-dependencies:
- dependency-name: "@angular/router"
  dependency-version: 19.2.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* build(deps): bump @angular/platform-browser in /angular

Bumps [@angular/platform-browser](https://github.com/angular/angular/tree/HEAD/packages/platform-browser) from 19.2.10 to 19.2.13.
- [Release notes](https://github.com/angular/angular/releases)
- [Changelog](https://github.com/angular/angular/blob/main/CHANGELOG.md)
- [Commits](https://github.com/angular/angular/commits/19.2.13/packages/platform-browser)

---
updated-dependencies:
- dependency-name: "@angular/platform-browser"
  dependency-version: 19.2.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: server/Dockerfile to reduce vulnerabilities

The following vulnerabilities are fixed with an upgrade:
- https://snyk.io/vuln/SNYK-DEBIAN12-GCC12-5901316
- https://snyk.io/vuln/SNYK-DEBIAN12-GCC12-5901316
- https://snyk.io/vuln/SNYK-DEBIAN12-GCC12-5901316
- https://snyk.io/vuln/SNYK-DEBIAN12-SHADOW-5879156
- https://snyk.io/vuln/SNYK-DEBIAN12-SHADOW-5879156

* fix: css styles and translations

* chore: fix authentication provider

* chore: fix line too long

* test: update test cases

* chore: prefer coalescing operator

* chore: prefer nullish coalescing operator

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: snyk-bot <snyk-bot@snyk.io>
2025-05-28 18:15:37 -03:00

50 lines
1.7 KiB
TypeScript

import React from 'react';
import { render } from '@testing-library/react';
import { describe, expect, it } from 'vitest';
import { MemoryRouter } from 'react-router';
import ContentHeader from '../../components/ContentHeader';
const headerProps = {
h1TextRegular: "Title part one",
h1TextBold: "Title part two",
subtitle: "This is the subtitle",
h2BlackText: "Another text part one",
h2GreenText: "Another green text",
isHomeComponent: false
};
describe('ContentHeader test cases', () => {
it('should render all the text elements', () => {
const { getByText } = render(<ContentHeader {...headerProps} />);
expect(getByText(headerProps.h1TextRegular)).toBeDefined();
expect(getByText(headerProps.h1TextBold)).toBeDefined();
expect(getByText(headerProps.subtitle)).toBeDefined();
expect(getByText(headerProps.h2BlackText)).toBeDefined();
expect(getByText(headerProps.h2GreenText)).toBeDefined();
});
it('should render all the text elements for home', () => {
const { getByText } = render(
<MemoryRouter>
<ContentHeader
{ ...headerProps }
isHomeComponent={true}
newTaskI18n="New task"
newNoteI18n="New note"
/>
</MemoryRouter>
);
expect(getByText(headerProps.h1TextRegular)).toBeDefined();
expect(getByText(headerProps.h1TextBold)).toBeDefined();
expect(getByText(headerProps.subtitle)).toBeDefined();
expect(getByText(headerProps.h2BlackText)).toBeDefined();
expect(getByText(headerProps.h2GreenText)).toBeDefined();
// renders only if it's the home (dashboard)
expect(getByText("New note")).toBeDefined();
expect(getByText("New task")).toBeDefined();
});
});