bcgov / bcgov/entity

SBC Common Components: external import can cause test failures

Open
#14,870 0 comments 0 reactions 0 assignees View on GitHub
bug ENTITY - DO NOT USE Pay Priority2
Dominant language
JavaScript
Stars
23
Forks
62
Avg merge
24m
Merged PRs (30d)
1

Description

The Sbc Header component uses another component named Notification Panel, which imports and uses an external library named "clickout-event".

This external library causes unit test errors if concurrent tests render the SBC Header component (eg, multiple test files mount App.vue). Ie:

![image.png](https://images.zenhubusercontent.com/5d0a7edda4644173e93bf808/9e2e5897-b8de-4647-b786-1c8c35b68a4e)

The author tried to work around this by mocking Sbc Header (so it wouldn't be rendered) but this didn't work. Instead, unit tests had to be moved to a single unit test file, in which describe blocks are run consecutively.

This issue may bite someone else in the future. I recommend looking for a better-implemented library to handle clickout events.

cc: @pwei1018 @seeker25

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the unit-test failure with concurrent mounts of App.vue, then trace the SBC Header to Notification Panel and its clickout-event import. Compare how the external library behaves across concurrent tests and evaluate a replacement or integration change. Done means concurrent SBC Header tests run without failures and no longer need to be consolidated into one file.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.