Skip to content

Commit

Permalink
Feature/background music and sounds (#35)
Browse files Browse the repository at this point in the history
fixed unit tests not running due to sounds not found
  • Loading branch information
katyaganina authored Jul 22, 2024
2 parents 59071de + ee9ee2e commit aa49f2f
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { ref, onMounted, onUnmounted } from 'vue';
import HomeView from '@/views/HomeView.vue';
import GameView from '@/views/GameView.vue';
import FinishView from '@/views/FinishView.vue';
import backgroundMusicSource from '/src/assets/music/background_music.mp3';
import clickSoundSource from '/src/assets/music/click_sound.mp3';
import backgroundMusicSource from '@/assets/music/background_music.mp3';
import clickSoundSource from '@/assets/music/click_sound.mp3';
const backgroundMusic = new Audio(backgroundMusicSource);
const clickSound = new Audio(clickSoundSource);
Expand Down
6 changes: 3 additions & 3 deletions src/components/ChatBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
import { ChatColor, ChatParticipant } from '@/models/chat';
import { watch } from 'vue';
import { chatHistory } from '@/services/chat';
import notificationSoundSource from '/src/assets/music/notification_sound.mp3';
import successSoundSource from '/src/assets/music/success_sound.mp3';
import errorSoundSource from '/src/assets/music/error_sound.mp3';
import notificationSoundSource from '@/assets/music/notification_sound.mp3';
import successSoundSource from '@/assets/music/success_sound.mp3';
import errorSoundSource from '@/assets/music/error_sound.mp3';
const notificationSound = new Audio(notificationSoundSource);
const successSound = new Audio(successSoundSource);
Expand Down
2 changes: 1 addition & 1 deletion src/components/CodeBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CodeVisualizer } from '@/services/code-visualizer';
import WordBox from '@/components/WordBox.vue';
import SelectBugModal from '@/components/SelectBugModal.vue';
import { ref, watch } from 'vue';
import clickSoundSource from '/src/assets/music/click_sound.mp3';
import clickSoundSource from '@/assets/music/click_sound.mp3';
const clickSound = new Audio(clickSoundSource);
const props = defineProps<{
Expand Down
1 change: 1 addition & 0 deletions src/shims-vue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ declare module '*.vue' {
const component: DefineComponent<{}, {}, any>
export default component
}
declare module "*.mp3";
2 changes: 1 addition & 1 deletion src/views/FinishView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import clickSoundSource from '/src/assets/music/click_sound.mp3';
import clickSoundSource from '@/assets/music/click_sound.mp3';
const clickSound = new Audio(clickSoundSource);
function closeGame() {
Expand Down
2 changes: 1 addition & 1 deletion src/views/GameView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ICode, ISolution } from '@/models/code';
import * as chat from '@/services/chat';
import { CodeFeedback } from '@/services/code-feedback';
import { Ref, ref } from 'vue';
import clickSoundSource from '/src/assets/music/click_sound.mp3';
import clickSoundSource from '@/assets/music/click_sound.mp3';
const clickSound = new Audio(clickSoundSource);
Expand Down
2 changes: 1 addition & 1 deletion src/views/HomeView.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { BASE_URL } from '@/app';
import { ref } from 'vue';
import clickSoundSource from '/src/assets/music/click_sound.mp3';
import clickSoundSource from '@/assets/music/click_sound.mp3'
const clickSound = new Audio(clickSoundSource);
const emit = defineEmits<{
Expand Down
1 change: 1 addition & 0 deletions tests/unit/bugfindergame.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Bug, Code, ErrorType, IBug, ICode, ISolution, Solution, Word } from '@/models/code';
import { BugFinderGame } from '@/services/bugfindergame';
import mockAxios from 'jest-mock-axios';
import clickSoundSource from '@/assets/music/click_sound.mp3'

jest.mock('axios');

Expand Down

0 comments on commit aa49f2f

Please sign in to comment.