Skip to content

Commit

Permalink
Do not render tooltip if member away
Browse files Browse the repository at this point in the history
  • Loading branch information
jouni-kantola committed Apr 7, 2024
1 parent 746916c commit 8adddbb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 1 addition & 1 deletion resources/scripts/components/TeamMember.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@keyup.enter="switchDriver"
@input="updateMemberName"
/>
<p v-if="tooltip" class="tooltip">{{ tooltip }}</p>
<p v-if="tooltip && isHere" class="tooltip">{{ tooltip }}</p>
</div>
</template>

Expand Down
21 changes: 20 additions & 1 deletion test/TeamMember-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,23 @@ test("highlight active member", () => {
});

assert.isTrue(wrapper.find(".current").exists());
});
});

test("no tooltip when away", async () => {
const wrapper = mount(TeamMember, {
props: {
index: 999,
name: "Team Member",
isActive: true,
tooltip: "Is here",
},
});

assert.isTrue(wrapper.find(".tooltip").exists());

const isHereToggle = wrapper.find("input[type='checkbox']:checked");
await isHereToggle.trigger("click");
await isHereToggle.trigger("change");

assert.isFalse(wrapper.find(".tooltip").exists());
});

0 comments on commit 8adddbb

Please sign in to comment.