Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes Issue 168 #169

Merged
merged 4 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions app/__tests__/intro_skip.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import '@testing-library/jest-dom';
import { render } from '@testing-library/react';
import React from 'react';

// TestComponent renders a button with the styles we want to test.
const TestComponent = () => {
return (
<button
className="introjs-skipbutton"
// Applying styles inline to ensure they are available during the test
style={{
fontSize: '1.0em',
left: 'auto',
right: '10px',
color: '#555',
}}
>
Skip
</button>
);
};

// Test to verify that the .introjs-skipbutton styles are applied correctly
test('renders .introjs-skipbutton with correct styles', () => {
// Render the TestComponent
const { getByText } = render(<TestComponent />);

// Select the button element by its text content
const skipButton = getByText('Skip');

// Assertions to verify that each style is applied as expected
expect(skipButton).toHaveStyle('font-size: 1.0em'); // Check font size
expect(skipButton).toHaveStyle('left: auto'); // Check left alignment
expect(skipButton).toHaveStyle('right: 10px'); // Check right position
expect(skipButton).toHaveStyle('color: #555'); // Check text color
});
9 changes: 9 additions & 0 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -473,3 +473,12 @@ body {
background: linear-gradient(to right, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.15) 100%);
pointer-events: none; /* This ensures the shadow doesn't interfere with clicking or scrolling */
}

/* Adjusts the position and size of the 'Skip' label */
.introjs-skipbutton {
font-size: 1.0em;
left: auto;
right: 10px;
color: #555;
}

3 changes: 2 additions & 1 deletion app/lib/pages/map/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Switch } from "@/components/ui/switch";
import { Skeleton } from "@/components/ui/skeleton";
import introJs from "intro.js"
import "intro.js/introjs.css"
import "../../../globals.css";

import {
CompassIcon,
Expand Down Expand Up @@ -119,7 +120,7 @@ const Page = () => {

scrollToElement: true,
dontShowAgain: true,
skipLabel: "Skip",
skipLabel: "Skip", //change the look of this button
amychen108 marked this conversation as resolved.
Show resolved Hide resolved
});

intro.oncomplete(() => {
Expand Down
Loading