Skip to content

util: add isLimitedJob helper function#1023

Open
Bing-su wants to merge 2 commits intoOverlayPlugin:mainfrom
Bing-su:util/isLimitedJobs
Open

util: add isLimitedJob helper function#1023
Bing-su wants to merge 2 commits intoOverlayPlugin:mainfrom
Bing-su:util/isLimitedJobs

Conversation

@Bing-su
Copy link
Collaborator

@Bing-su Bing-su commented Mar 5, 2026

Adds a helper to identify limited jobs (currently BLU) and its unit tests.

I think it would be helpful to add this before the Beastmaster release.

Adds a helper to identify limited jobs (currently BLU) and its unit tests.
@Bing-su Bing-su requested a review from Copilot March 5, 2026 05:36
@github-actions github-actions bot added resources /resources test /test, /ui/test needs-review Awaiting review labels Mar 5, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a helper function isLimitedJob to resources/util.ts, which identifies limited jobs (currently only BLU / Blue Mage) using a dedicated limitedJobs array. The PR also includes unit tests for this new helper. It is described as preparatory work ahead of the Beastmaster job release.

Changes:

  • Adds a limitedJobs array and isLimitedJob helper function to resources/util.ts, consistent with existing job classification helpers.
  • Adds a unit test for isLimitedJob in test/unittests/util_test.ts, verifying BLU returns true and all other tested jobs return false.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
resources/util.ts Adds limitedJobs constant array and isLimitedJob method to the Util object
test/unittests/util_test.ts Adds a test case asserting limited jobs are correctly identified by Util.isLimitedJob

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 14 to 15
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const healerJobs: Job[] = ['CNJ', 'WHM', 'SCH', 'AST', 'SGE'];
const meleeDpsJobs: Job[] = ['PGL', 'MNK', 'LNC', 'DRG', 'ROG', 'NIN', 'SAM', 'RPR', 'VPR'];

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const casterDpsJobs: Job[] = ['BLU', 'RDM', 'BLM', 'SMN', 'ACN', 'THM', 'PCT'];

);
});
it('jobs should be set as limited jobs correctly', () => {
const limitedJobs: Job[] = ['BLU'];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer if we kept all the job constants together so they are easier to find/update; we're already doing a poor job of keeping this file up-to-date with new jobs as evidenced by SGE, RPR, VPR, and PCT being missing.

Copy link
Collaborator Author

@Bing-su Bing-su Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to export the consts from util.ts for reuse.

@github-actions github-actions bot removed the needs-review Awaiting review label Mar 5, 2026
Expose per-category job arrays (allJobs, tankJobs, healerJobs, meleeDpsJobs, rangedDpsJobs, casterDpsJobs, dpsJobs, craftingJobs, gatheringJobs, limitedJobs) so they can be reused across the codebase and tests. Update tests to import and rely on these exports instead of duplicating definitions, ensuring consistent references for isLimitedJob tests and related utilities.
@github-actions github-actions bot added the needs-review Awaiting review label Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Awaiting review resources /resources test /test, /ui/test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants