Skip to content

Commit

Permalink
fix(lint): Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
drikusroor committed Jun 28, 2024
1 parent 7ab876a commit 45e5a58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
14 changes: 7 additions & 7 deletions frontend/src/components/Final/Final.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ describe('Final Component', () => {
</BrowserRouter>
);

expect(screen.queryByText(/Final Text/i)).to.exist;
expect(screen.queryByTestId('score')).to.exist;
expect(document.body.contains(screen.queryByText('Final Text'))).toBe(true);
expect(document.body.contains(screen.queryByTestId('score'))).toBe(true);
});

it('calls onNext prop when button is clicked', async () => {
Expand Down Expand Up @@ -85,8 +85,8 @@ describe('Final Component', () => {
</BrowserRouter>
);

expect(screen.queryByText('Rank')).to.not.exist;
expect(screen.queryByText('Social')).to.not.exist;
expect(document.body.contains(screen.queryByTestId('rank'))).toBe(false);
expect(document.body.contains(screen.queryByTestId('social'))).toBe(false);
});

it('navigates to profile page when profile link is clicked', async () => {
Expand All @@ -109,7 +109,7 @@ describe('Final Component', () => {

const profileLink = screen.getByTestId('profile-link');

expect(profileLink).to.exist;
expect(document.body.contains(profileLink)).toBe(true);

expect(history.location.pathname).toBe('/');

Expand Down Expand Up @@ -145,7 +145,7 @@ describe('Final Component', () => {
);

const el = screen.getByTestId('button-link');
expect(el).to.exist;
expect(document.body.contains(el)).toBe(true);
expect(el.getAttribute('href')).toBe('/redirect/aml');
});

Expand All @@ -159,7 +159,7 @@ describe('Final Component', () => {
);

const el = screen.getByTestId('button-link');
expect(el).to.exist;
expect(document.body.contains(el)).toBe(true);
expect(el.getAttribute('href')).toBe('https://example.com');
});

Expand Down
3 changes: 1 addition & 2 deletions frontend/src/components/Final/Final.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect, useRef } from "react";
import React, { useEffect } from "react";
import { withRouter } from "react-router-dom";

import Rank from "../Rank/Rank";
Expand All @@ -18,7 +18,6 @@ import FinalButton from "./FinalButton";
const Final = ({ block, participant, score, final_text, action_texts, button,
onNext, history, show_participant_link, participant_id_only,
show_profile_link, social, feedback_info, points, rank, logo }) => {
const [showScore, setShowScore] = useState(0);
const session = useBoundStore((state) => state.session);

useEffect(() => {
Expand Down

0 comments on commit 45e5a58

Please sign in to comment.