Commit Graph

14 Commits

Author SHA1 Message Date
Refringe
a572e8e67e
Runs Style Fix 2024-04-22 15:53:07 -04:00
Brent
c71aaa7fb3 Use dynamic ragfair pricing for insurance deletion sorting (!294)
Change sort value for insured attachments to use dynamic ragfair prices.
Small change to method to return directly instead of setting passed-by-value parameter.

https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/618

Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/294
Co-authored-by: Brent <wiggyvidyadev@gmail.com>
Co-committed-by: Brent <wiggyvidyadev@gmail.com>
2024-04-17 13:10:43 +00:00
Refringe
0e63ced3ac
Test - Insurance - Updates for v3.8
- Updates the tests for insuranceController methods for v3.8
- Updates the profileInsurance fixture with updated insurance packages for v3.8
- Updated the profileInsurance factory to remove outdated references as of v3.8
2024-04-11 21:18:38 -04:00
Refringe
34121182a1
Biome Linting Issues
Fixed some instances of:
- Unordered imports
- Reassigning function parameters
- Modifying values in assignment/return statements
- Array.forEach being used instead of for...of
- Simplified control logic
2024-02-05 19:03:26 -05:00
Refringe
5d2af422cb
Fixes InsuranceController Tests 2023-11-16 23:55:32 -05:00
Refringe
0793df60c2
Formatting Change - Space is now given around object properties. 2023-11-13 12:38:16 -05:00
Refringe
32b47bdc18
Formatting Change - When a statement can be moved into a single line and still be under the maximum line length, it is. 2023-11-13 12:31:52 -05:00
Refringe
11b5c76512
Favours single line variable declarations. 2023-11-13 11:51:52 -05:00
Refringe
320c8b7d48
Formatting for test classes. 2023-11-10 17:21:20 -05:00
Refringe
65202b2aff
Remove the resetAllMocks call because restoreAllMocks does the same thing, plus restores the mocked method's original functionality. 2023-11-06 15:35:46 -05:00
Refringe
a7d3e0d59a
Tests: Moves class (re)resolution to beforeEach to help ensure that all mocks have been reset. 2023-11-06 14:39:12 -05:00
Refringe
047884e9c7
Additional InsuranceController Tests
- Adds tests for the remaining methods in the `InsuranceController`.
- Adds a `countAllInsuranceItems()` method to the `InsuranceController`.
- Adds the Vitest UI and coverage packages.
- Updates the `profileInsuranceFactory` to use second-epoch dates instead of millisecond-epoch dates.
- Updates the `InsuranceController.fetchHideoutItemParent()` method to log a warning when an item with a slotId of 'hideout' cannot be found.

TODO:
- The Vitest coverage options are not working.
2023-11-03 17:39:33 -04:00
Refringe
85a227e7d5
Updates 🚀
- Created profileInsurance test fixture.
- Created ProfileInsurance test factory class.
- Improved many of the InsuranceController method tests by utilizing the factory and fixture. Still some left to do here.
- Adds the `date-fns` package as a development dependancy for easy date manipulation.
- Cleaned up some comments.

Bug Fixes 🐞
- Resolved an issue where `ItemHelper.getAttachmentMainParent()` was not returning null when it should have.
- Resolved an issue where `InsuranceController.populateParentAttachmentsMap()` would continue to process when the parent could not be found.
2023-11-02 01:47:28 -04:00
Refringe
7f37d48753
InsuranceController Tests & Minor Changes
- Adds tests for the majority of the methods within InsuranceController.
- Simplifies the `InsuranceController.sendMail()` method so that the toDelete parameter is no longer required.
- Modifies `InsuranceController.findItemsToDelete()` to only process regular and attachment items when they exist.
- Modifies `InsuranceController.rollForDelete()` to return null in the event that the provided Trader can not be found.
2023-10-31 23:08:13 -04:00