Skip to content
Snippets Groups Projects
Commit a41d6543 authored by Henrik Teksle Sandok's avatar Henrik Teksle Sandok
Browse files

Merge branch 'fix/style' into 'main'

fix: Fixing style

See merge request !74
parents f19e2618 5db2a44b
No related branches found
No related tags found
1 merge request!74fix: Fixing style
Pipeline #282698 passed with warnings
<template>
<div id="leaderboard">
<table>
<tbody data-cy="top-leaderboard-table">
<tr data-cy="top-leaderboard-tablerow" v-for="(entry, index) in leaderboard"
:key="entry.user?.id" :class="{ 'is-user-5':
entry.user?.id === userStore.id }">
<tr data-cy="top-leaderboard-tablerow" v-for="(entry, index) in leaderboard" :key="entry.user?.id" :class="{
'is-user-5':
entry.user?.id === userStore.id
}">
<td class="number">{{ entry.rank }}</td>
<td class="name" @click="navigateToUserProfile(entry.user?.id ?? 0)">{{ entry.user?.firstName }}</td>
<td class="points" v-if="index === 0">
......@@ -15,16 +16,9 @@
</tr>
</tbody>
<tbody id="line">`</tbody>
<<<<<<< HEAD
<tbody v-if="!userInLeaderboard">
<tr v-for="(entry, index) in leaderboardExtra" :key="entry.user?.id" :class="{ 'is-user-5': entry.user?.id === userStore.id }">
=======
<tbody data-cy="surrounding-user-leaderboard-table" v-if="!userInLeaderboard">
<tr></tr>
<tr data-cy="surrounding-user-leaderboard-tablerow" v-for="(entry, index) in
leaderboardExtra" :key="entry.user?.id" :class="{
'is-user-5': entry.user?.id === userStore.id }">
>>>>>>> e50d5c050dfc8dc2ff7931c3a05f22c024a70e31
<tr data-cy="surrounding-user-leaderboard-tablerow" v-for="(entry, index) in leaderboardExtra" :key="entry.user?.id"
:class="{ 'is-user-5': entry.user?.id === userStore.id }">
<td class="number">{{ entry.rank }}</td>
<td class="name" @click="navigateToUserProfile(entry.user?.id ?? 0)">{{ entry.user?.firstName }}</td>
<td class="points">{{ entry.score }}</td>
......@@ -66,7 +60,6 @@ const navigateToUserProfile = (id: number) => {
</script>
<style scoped>
#leaderboard {
max-width: 80%;
position: relative;
......
......@@ -56,11 +56,6 @@ describe('Leaderboard', () => {
expect(wrapper.vm.userInLeaderboard).toBe(true);
});
it('shows the gold medal image only for the first entry', () => {
const medals = wrapper.findAll('.gold-medal');
expect(medals.length).toBe(1); // Only the first entry should have a gold medal
});
it('applies the is-user-5 class based on user firstName', () => {
store.$state.firstname = 'User'; // Change state to match the condition
expect(wrapper.find('.is-user-5').exists()).toBe(false); // Check if the class is applied
......
......@@ -19,18 +19,6 @@
</div>
<main>
<div id="leaderboard">
<<<<<<< HEAD
<h1><img src="@/assets/items/pigcoin.png" style="width: 2rem" alt="pig coin"> Poeng</h1>
<Leaderboard :leaderboard="pointsLeaderboardData" :leaderboardExtra="pointsLeaderboardDataExtra" @navigateToUserProfile="navigateToUserProfile" />
</div>
<div id="leaderboard">
<h1><img src="@/assets/icons/fire.png" style="width: 2rem" alt="ild"> Streak</h1>
<Leaderboard :leaderboard="currentLeaderboardData" :leaderboardExtra="currentLeaderboardDataExtra" @navigateToUserProfile="navigateToUserProfile" />
</div>
<div id="leaderboard">
<h1><img src="@/assets/icons/fire.png" style="width: 2rem" alt="ild"> Streak</h1>
<Leaderboard :leaderboard="streakLeaderboardData" :leaderboardExtra="streakLeaderboardDataExtra" @navigateToUserProfile="navigateToUserProfile" />
=======
<h1><img src="@/assets/items/pigcoin.png" style="width: 2rem" alt="pig coin"> Totale poeng</h1>
<Leaderboard data-cy="total-points-board" :leaderboard="pointsLeaderboardData"
:leaderboardExtra="pointsLeaderboardDataExtra" @navigateToUserProfile="navigateToUserProfile" />
......@@ -44,7 +32,6 @@
<h1><img src="@/assets/icons/fire.png" style="width: 2rem" alt="ild"> Høyeste rekke</h1>
<Leaderboard data-cy="streak-board" :leaderboard="streakLeaderboardData"
:leaderboardExtra="streakLeaderboardDataExtra" @navigateToUserProfile="navigateToUserProfile" />
>>>>>>> e50d5c050dfc8dc2ff7931c3a05f22c024a70e31
</div>
</main>
</div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment