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

Feat/56 add projects nav item to link to projects section #72

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
5 changes: 3 additions & 2 deletions src/lib/components/Projects.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<script>
import { Section } from '$lib/utils';
import ssoWebsiteImage from '../assets/projects-images/project-sso-website.png';
import sitaDbImage from '../assets/projects-images/project-sso-sitadb.png';
import { IconBrandGithubFilled, IconClick } from '@tabler/icons-svelte';
</script>

<div class="container px-5 py-2 lg:px-32 lg:py-24 bg-transparent mx-auto w-full">
<div id={Section.Projects} class="container px-5 py-2 lg:px-32 lg:py-24 bg-transparent mx-auto w-full">
<h1 class="text-4xl font-bold text-center pb-8">Featured Projects</h1>

<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
Expand Down Expand Up @@ -52,7 +53,7 @@
<div class="flex gap-2 mt-4">
<a
rel="external"
href="#"
href="#/"
class="bg-blue-500 hover:bg-blue-600 text-white font-bold py-2 px-4 rounded flex items-center"
>
<IconClick class="mr-2" /> Try it Now
Expand Down
8 changes: 7 additions & 1 deletion src/lib/utils/menuItems.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ export const Section = {
Media: 'Media',
Contributors: 'Contributors',
Contact: 'Contact',
About: 'About'
About: 'About',
Projects: 'Projects',
};

export const menuItems = [
Expand All @@ -19,6 +20,11 @@ export const menuItems = [
name: 'About',
icon: IconCar
},
{
ref: `#${Section.Projects}`,
name: 'Projects',
icon: IconCar
},
{
ref: `#${Section.Media}`,
name: 'Media',
Expand Down
11 changes: 8 additions & 3 deletions tests/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,17 @@ import { expect, test } from '@playwright/test';
test('Hero section has expected p', async ({ page }) => {
await page.goto('/');
await expect(
page.getByText(
'Press Join us Now to find out more about becoming a Samoa Code Hub Member'
)
page.getByText('Press Join us Now to find out more about becoming a Samoa Code Hub Member')
).toBeVisible();
});


test('Clicking "Projects" button navigates to projects page and displays Featured Projects h1', async ({ page }) => {
await page.goto('/');
await page.click('text=Projects');
await expect(page.locator('h1:has-text("Featured Projects")')).toBeVisible();
});

test('Media section has expected h1', async ({ page }) => {
await page.goto('/');
await expect(page.getByText('Samoa Code Hub Meet Ups')).toBeVisible();
Expand Down