Skip to content

Commit

Permalink
fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ayandajuqu committed Sep 18, 2024
1 parent 43f1676 commit c8e37fa
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 21 deletions.
1 change: 0 additions & 1 deletion src/src/lib/components/annotations/3dAnnotations.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import { CSS2DRenderer, CSS2DObject } from 'three/examples/jsm/renderers/CSS2DRenderer.js';
import Menu from '$lib/components/hotspot/3dMenu.svelte';
import { Button } from 'flowbite-svelte';

Check warning on line 8 in src/src/lib/components/annotations/3dAnnotations.svelte

View check run for this annotation

Codecov / codecov/patch

src/src/lib/components/annotations/3dAnnotations.svelte#L1-L8

Added lines #L1 - L8 were not covered by tests
let canvas: HTMLCanvasElement;
let camera: THREE.PerspectiveCamera, scene: THREE.Scene, renderer: THREE.WebGLRenderer;
Expand Down
3 changes: 1 addition & 2 deletions src/src/lib/components/modals/quizzes/Edit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
const questionTypes = [
{ value: 'multiple-choice', name: 'Multiple Choice' },
{ value: '3d-hotspot', name: '3D Hot Spot' },
{ value: 'true-false', name: '3D True or False' }
{ value: '3d-hotspot', name: '3D Hot Spot' }
];
function confirmSelection() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const load: PageServerLoad = async ({ params, locals }) => {
content: option.content,
points: option.points
}))
: null
: null

Check warning on line 41 in src/src/routes/(app)/workspaces/[workspace]/quizzes/[quiz]/+page.server.ts

View check run for this annotation

Codecov / codecov/patch

src/src/routes/(app)/workspaces/[workspace]/quizzes/[quiz]/+page.server.ts#L36-L41

Added lines #L36 - L41 were not covered by tests
})),
workspaceID,
models

Check warning on line 44 in src/src/routes/(app)/workspaces/[workspace]/quizzes/[quiz]/+page.server.ts

View check run for this annotation

Codecov / codecov/patch

src/src/routes/(app)/workspaces/[workspace]/quizzes/[quiz]/+page.server.ts#L43-L44

Added lines #L43 - L44 were not covered by tests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { describe, it, expect, vi, beforeEach } from 'vitest';
//import mongoose from 'mongoose';

Expand Down
7 changes: 2 additions & 5 deletions src/src/tests/unit/components/modal/createQuiz.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, it, expect } from 'vitest';
import { render, fireEvent } from '@testing-library/svelte';
import ModalComponent from '$lib/components/modals/quizzes/Add.svelte';
import ModalComponent from '$lib/components/modals/quizzes/Add.svelte';

describe('ModalComponent - Add Quiz Modal', () => {
const defaultProps = {
Expand All @@ -23,10 +23,8 @@ describe('ModalComponent - Add Quiz Modal', () => {
expect(queryByText('Add Quiz')).not.toBeInTheDocument();
});



it('should submit form with valid inputs', async () => {
const { getByLabelText, getByRole, getByText } = render(ModalComponent, {
const { getByLabelText, getByRole } = render(ModalComponent, {
props: { ...defaultProps }
});

Expand All @@ -35,7 +33,6 @@ describe('ModalComponent - Add Quiz Modal', () => {
const instructionsTextarea = getByLabelText('Add Instructions') as HTMLTextAreaElement;
const submitButton = getByRole('button', { name: 'Create Quiz' });


await fireEvent.input(titleInput, { target: { value: 'New Quiz' } });
await fireEvent.input(durationInput, { target: { value: '45' } });
await fireEvent.input(instructionsTextarea, { target: { value: 'These are instructions.' } });
Expand Down
8 changes: 2 additions & 6 deletions src/src/tests/unit/components/modal/submission.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, it, expect, vi } from 'vitest';
import { render, fireEvent } from '@testing-library/svelte';
import ModalComponent from '$lib/components/modals/quizzes/Submission.svelte'; // Adjust the import path as needed
import { render } from '@testing-library/svelte';
import ModalComponent from '$lib/components/modals/quizzes/Submission.svelte';

// Mock the navigation function
vi.mock('$utils/navigation', () => ({
Expand Down Expand Up @@ -30,8 +30,6 @@ describe('ModalComponent - Quiz Submission Modal', () => {
expect(queryByText('Quiz Submission')).not.toBeInTheDocument();
});



it('should display submission message and percentage score correctly', () => {
const { getByText } = render(ModalComponent, {
props: defaultProps
Expand All @@ -40,6 +38,4 @@ describe('ModalComponent - Quiz Submission Modal', () => {
expect(getByText('Your quiz has been submitted successfully!')).toBeInTheDocument();
expect(getByText('Percentage Score: 85.50%')).toBeInTheDocument();
});


});
6 changes: 1 addition & 5 deletions src/src/tests/unit/components/modal/timeElasped.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { describe, it, expect, vi } from 'vitest';
import { render, fireEvent } from '@testing-library/svelte';
import { render } from '@testing-library/svelte';
import ModalComponent from '$lib/components/modals/quizzes/TimeElapsed.svelte'; // Adjust the import path as needed

// Mock the navigation function
Expand Down Expand Up @@ -30,8 +30,6 @@ describe('ModalComponent - Time Elapsed Modal', () => {
expect(queryByText('Time Elapsed')).not.toBeInTheDocument();
});



it('should display submission message and total points correctly', () => {
const { getByText } = render(ModalComponent, {
props: defaultProps
Expand All @@ -40,6 +38,4 @@ describe('ModalComponent - Time Elapsed Modal', () => {
expect(getByText('Time is up! You have completed the quiz.')).toBeInTheDocument();
expect(getByText('Total Points: 85')).toBeInTheDocument();
});


});

0 comments on commit c8e37fa

Please sign in to comment.