Skip to content

Commit e66e339

Browse files
applied linting changes
1 parent cb2fd33 commit e66e339

File tree

6 files changed

+130
-103
lines changed

6 files changed

+130
-103
lines changed

src/client/package.json

Lines changed: 63 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,65 @@
11
{
2-
"name": "client",
3-
"version": "0.0.1",
4-
"scripts": {
5-
"dev": "vite dev",
6-
"build": "vite build",
7-
"preview": "vite preview",
8-
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
9-
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
10-
"lint": "prettier --check . && eslint .",
11-
"format": "prettier --write .",
12-
"cy:open-ct": "cypress open --component",
13-
"cy:run-ct": "cypress run --e2e",
14-
15-
"test": "vitest run",
16-
"test:ui": "vitest --ui",
17-
"test:watch": "vitest"
18-
},
19-
"devDependencies": {
20-
"@cypress/code-coverage": "^3.12.39",
21-
"@fontsource/fira-mono": "^4.5.10",
22-
"@fontsource/roboto": "^5.0.13",
23-
"@neoconfetti/svelte": "^1.0.0",
24-
"@sveltejs/adapter-auto": "^3.0.0",
25-
"@sveltejs/kit": "^2.0.0",
26-
"@sveltejs/vite-plugin-svelte": "^3.1.1",
27-
"@tailwindcss/typography": "^0.5.10",
28-
"@testing-library/jest-dom": "^6.4.5",
29-
"@testing-library/svelte": "^5.1.0",
30-
"@types/eslint": "^8.56.0",
31-
"@typescript-eslint/eslint-plugin": "^7.0.0",
32-
"@typescript-eslint/parser": "^7.0.0",
33-
"@vitest/ui": "^1.6.0",
34-
"autoprefixer": "^10.4.16",
35-
"cypress": "^13.10.0",
36-
"cypress-svelte-unit-test": "^3.3.4",
37-
"eslint": "^8.56.0",
38-
"eslint-config-prettier": "^9.1.0",
39-
"eslint-plugin-svelte": "^2.35.1",
40-
"flowbite": "^2.3.0",
41-
"flowbite-svelte": "^0.46.1",
42-
"flowbite-svelte-icons": "^1.6.1",
43-
"istanbul-lib-coverage": "^3.2.2",
44-
"jsdom": "^24.1.0",
45-
"nyc": "^15.1.0",
46-
"postcss": "^8.4.33",
47-
"prettier": "^3.1.1",
48-
"prettier-plugin-svelte": "^3.1.2",
49-
"prettier-plugin-tailwindcss": "^0.5.1",
50-
"svelte": "^4.2.7",
51-
"svelte-check": "^3.6.0",
52-
"tailwindcss": "^3.4.1",
53-
"tslib": "^2.4.1",
54-
"typescript": "^5.0.0",
55-
"vite": "^5.0.3",
56-
"vitest": "^1.6.0"
57-
},
58-
"type": "module",
59-
"dependencies": {
60-
"@threlte/core": "^7.3.0",
61-
"axios": "^1.7.2",
62-
"clsx": "^2.1.1",
63-
"tailwind-merge": "^2.3.0",
64-
"three": "^0.165.0"
65-
}
2+
"name": "client",
3+
"version": "0.0.1",
4+
"scripts": {
5+
"dev": "vite dev",
6+
"build": "vite build",
7+
"preview": "vite preview",
8+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
9+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
10+
"lint": "prettier --check . && eslint .",
11+
"format": "prettier --write .",
12+
"cy:open-ct": "cypress open --component",
13+
"cy:run-ct": "cypress run --e2e",
14+
"test": "vitest run",
15+
"test:ui": "vitest --ui",
16+
"test:watch": "vitest"
17+
},
18+
"devDependencies": {
19+
"@cypress/code-coverage": "^3.12.39",
20+
"@fontsource/fira-mono": "^4.5.10",
21+
"@fontsource/roboto": "^5.0.13",
22+
"@neoconfetti/svelte": "^1.0.0",
23+
"@sveltejs/adapter-auto": "^3.0.0",
24+
"@sveltejs/kit": "^2.0.0",
25+
"@sveltejs/vite-plugin-svelte": "^3.1.1",
26+
"@tailwindcss/typography": "^0.5.10",
27+
"@testing-library/jest-dom": "^6.4.5",
28+
"@testing-library/svelte": "^5.1.0",
29+
"@types/eslint": "^8.56.0",
30+
"@typescript-eslint/eslint-plugin": "^7.0.0",
31+
"@typescript-eslint/parser": "^7.0.0",
32+
"@vitest/ui": "^1.6.0",
33+
"autoprefixer": "^10.4.16",
34+
"cypress": "^13.10.0",
35+
"cypress-svelte-unit-test": "^3.3.4",
36+
"eslint": "^8.56.0",
37+
"eslint-config-prettier": "^9.1.0",
38+
"eslint-plugin-svelte": "^2.35.1",
39+
"flowbite": "^2.3.0",
40+
"flowbite-svelte": "^0.46.1",
41+
"flowbite-svelte-icons": "^1.6.1",
42+
"istanbul-lib-coverage": "^3.2.2",
43+
"jsdom": "^24.1.0",
44+
"nyc": "^15.1.0",
45+
"postcss": "^8.4.33",
46+
"prettier": "^3.1.1",
47+
"prettier-plugin-svelte": "^3.1.2",
48+
"prettier-plugin-tailwindcss": "^0.5.1",
49+
"svelte": "^4.2.7",
50+
"svelte-check": "^3.6.0",
51+
"tailwindcss": "^3.4.1",
52+
"tslib": "^2.4.1",
53+
"typescript": "^5.0.0",
54+
"vite": "^5.0.3",
55+
"vitest": "^1.6.0"
56+
},
57+
"type": "module",
58+
"dependencies": {
59+
"@threlte/core": "^7.3.0",
60+
"axios": "^1.7.2",
61+
"clsx": "^2.1.1",
62+
"tailwind-merge": "^2.3.0",
63+
"three": "^0.165.0"
64+
}
6665
}

src/client/src/testing/Activities.test.ts

Lines changed: 44 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,50 @@ import { expect, test } from 'vitest';
33
import ActivityTimeline from '../lib/components/admin/+Activities.svelte';
44

55
test('renders activities correctly', () => {
6-
const { getByText } = render(ActivityTimeline);
6+
const { getByText } = render(ActivityTimeline);
77

8-
// Check that each activity title and description is rendered
9-
const activities = [
10-
{ title: 'Budget Planning Meeting', date: '15 Oct', activity: 'Attend and contribute to the annual budget planning meeting to allocate resources for the upcoming academic year.' },
11-
{ title: 'Faculty Evaluation', date: '18 Oct', activity: 'Conduct evaluations for tenured and non-tenured faculty members, reviewing their performance and providing feedback.' },
12-
{ title: 'Student Affairs Committee', date: '20 Oct', activity: 'Participate in the Student Affairs Committee meeting to discuss and address student concerns and initiatives.' },
13-
{ title: 'Campus Safety Review', date: '22 Oct', activity: 'Review campus safety protocols and emergency procedures with the safety department to ensure the well-being of students and staff.' },
14-
{ title: 'Strategic Planning Workshop', date: '25 Oct', activity: 'Engage in a strategic planning workshop to set long-term goals and objectives for the university’s growth and development.' },
15-
{ title: 'Alumni Networking Event', date: '30 Oct', activity: 'Host an alumni networking event to strengthen relationships with former students and encourage their involvement in university activities.' }
16-
];
8+
// Check that each activity title and description is rendered
9+
const activities = [
10+
{
11+
title: 'Budget Planning Meeting',
12+
date: '15 Oct',
13+
activity:
14+
'Attend and contribute to the annual budget planning meeting to allocate resources for the upcoming academic year.'
15+
},
16+
{
17+
title: 'Faculty Evaluation',
18+
date: '18 Oct',
19+
activity:
20+
'Conduct evaluations for tenured and non-tenured faculty members, reviewing their performance and providing feedback.'
21+
},
22+
{
23+
title: 'Student Affairs Committee',
24+
date: '20 Oct',
25+
activity:
26+
'Participate in the Student Affairs Committee meeting to discuss and address student concerns and initiatives.'
27+
},
28+
{
29+
title: 'Campus Safety Review',
30+
date: '22 Oct',
31+
activity:
32+
'Review campus safety protocols and emergency procedures with the safety department to ensure the well-being of students and staff.'
33+
},
34+
{
35+
title: 'Strategic Planning Workshop',
36+
date: '25 Oct',
37+
activity:
38+
'Engage in a strategic planning workshop to set long-term goals and objectives for the university’s growth and development.'
39+
},
40+
{
41+
title: 'Alumni Networking Event',
42+
date: '30 Oct',
43+
activity:
44+
'Host an alumni networking event to strengthen relationships with former students and encourage their involvement in university activities.'
45+
}
46+
];
1747

18-
activities.forEach(activity => {
19-
expect(getByText(activity.title)).toBeInTheDocument();
20-
expect(getByText(activity.activity)).toBeInTheDocument();
21-
});
48+
activities.forEach((activity) => {
49+
expect(getByText(activity.title)).toBeInTheDocument();
50+
expect(getByText(activity.activity)).toBeInTheDocument();
51+
});
2252
});
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { render } from '@testing-library/svelte';
22
import Degree from '../lib/components/admin/+Degrees.svelte';
3-
import {expect,test} from 'vitest';
3+
import { expect, test } from 'vitest';
44
import { degrees } from '../routes/degrees';
55

6-
76
degrees.forEach((degree) => {
8-
test(`displays the degree: ${degree.program}`, () => {
9-
const { getByText } = render(Degree, { degrees });
10-
expect(getByText(degree.program)).toBeVisible();
11-
});
7+
test(`displays the degree: ${degree.program}`, () => {
8+
const { getByText } = render(Degree, { degrees });
9+
expect(getByText(degree.program)).toBeVisible();
10+
});
1211
});

src/client/src/testing/Workspace.test.ts

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@ import { render } from '@testing-library/svelte';
33
import { expect, test } from 'vitest';
44
import Workspaces from '../lib/components/admin/+Workspaces.svelte';
55

6-
76
test('it renders the correct number of workspace cards', () => {
8-
const workspaces = [
9-
{ title: 'COS 333', description: 'Programming languages', image: 'COS333.png' },
10-
{ title: 'COS 314', description: 'Artificial Intelligence', image: 'COS314.png' },
11-
{ title: 'COS 344', description: 'Computer Graphics', image: 'COS344.png' }
12-
];
13-
14-
const { getByText } = render(Workspaces, { props: { workspaces } });
7+
const workspaces = [
8+
{ title: 'COS 333', description: 'Programming languages', image: 'COS333.png' },
9+
{ title: 'COS 314', description: 'Artificial Intelligence', image: 'COS314.png' },
10+
{ title: 'COS 344', description: 'Computer Graphics', image: 'COS344.png' }
11+
];
12+
13+
const { getByText } = render(Workspaces, { props: { workspaces } });
1514

16-
expect(getByText('COS 333')).toBeInTheDocument();
17-
expect(getByText('Programming languages')).toBeInTheDocument();
18-
expect(getByText('COS 314')).toBeInTheDocument();
19-
expect(getByText('Artificial Intelligence')).toBeInTheDocument();
20-
expect(getByText('COS 344')).toBeInTheDocument();
21-
expect(getByText('Computer Graphics')).toBeInTheDocument();
15+
expect(getByText('COS 333')).toBeInTheDocument();
16+
expect(getByText('Programming languages')).toBeInTheDocument();
17+
expect(getByText('COS 314')).toBeInTheDocument();
18+
expect(getByText('Artificial Intelligence')).toBeInTheDocument();
19+
expect(getByText('COS 344')).toBeInTheDocument();
20+
expect(getByText('Computer Graphics')).toBeInTheDocument();
2221
});

src/client/vite.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { sveltekit } from '@sveltejs/kit/vite';
22
import { defineConfig } from 'vitest/config';
3-
import {svelteTesting} from '@testing-library/svelte/vite'
3+
import { svelteTesting } from '@testing-library/svelte/vite';
44

55
export default defineConfig({
6-
plugins: [sveltekit(),svelteTesting()],
6+
plugins: [sveltekit(), svelteTesting()],
77
test: {
88
environment: 'jsdom',
9-
setupFiles: ['./vitest-setup.js'],
10-
},
9+
setupFiles: ['./vitest-setup.js']
10+
},
1111
ssr: {
1212
noExternal: ['three']
1313
}

src/client/vitest-setup.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
import '@testing-library/jest-dom/vitest'
1+
import '@testing-library/jest-dom/vitest';

0 commit comments

Comments
 (0)