style: apply prettier formatting to test files
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -139,7 +139,10 @@ describe('AuthApplicationService', () => {
|
|||||||
const user = UserFactory.createUserDefault()
|
const user = UserFactory.createUserDefault()
|
||||||
let resolveLogin: (value: boolean) => void
|
let resolveLogin: (value: boolean) => void
|
||||||
mockSessionManager.loginByComputerName.mockImplementation(
|
mockSessionManager.loginByComputerName.mockImplementation(
|
||||||
() => new Promise<boolean>((resolve) => { resolveLogin = resolve })
|
() =>
|
||||||
|
new Promise<boolean>((resolve) => {
|
||||||
|
resolveLogin = resolve
|
||||||
|
})
|
||||||
)
|
)
|
||||||
mockSessionManager.getUserInfo.mockReturnValue({
|
mockSessionManager.getUserInfo.mockReturnValue({
|
||||||
id: user.id,
|
id: user.id,
|
||||||
@@ -213,10 +216,7 @@ describe('AuthApplicationService', () => {
|
|||||||
|
|
||||||
describe('getAllUsers', () => {
|
describe('getAllUsers', () => {
|
||||||
it('should delegate to session manager', async () => {
|
it('should delegate to session manager', async () => {
|
||||||
const users = [
|
const users = [UserFactory.createAdmin(), UserFactory.createUserDefault()]
|
||||||
UserFactory.createAdmin(),
|
|
||||||
UserFactory.createUserDefault()
|
|
||||||
]
|
|
||||||
mockSessionManager.getAllUsers.mockResolvedValue(users)
|
mockSessionManager.getAllUsers.mockResolvedValue(users)
|
||||||
|
|
||||||
const result = await service.getAllUsers()
|
const result = await service.getAllUsers()
|
||||||
|
|||||||
@@ -134,9 +134,7 @@ describe('ValidationApplicationService', () => {
|
|||||||
filteredMaterialRecords = [
|
filteredMaterialRecords = [
|
||||||
{ MaterialName: 'FilteredMat', MaterialCode: 'MF1', Model: 'FMod', Specification: 'FSpec' }
|
{ MaterialName: 'FilteredMat', MaterialCode: 'MF1', Model: 'FMod', Specification: 'FSpec' }
|
||||||
]
|
]
|
||||||
materialsByManagerResult = [
|
materialsByManagerResult = [{ materialCode: 'M1', managerName: 'Mgr' }]
|
||||||
{ materialCode: 'M1', managerName: 'Mgr' }
|
|
||||||
]
|
|
||||||
allMaterialsResult = [
|
allMaterialsResult = [
|
||||||
{ materialCode: 'M1', managerName: 'Mgr' },
|
{ materialCode: 'M1', managerName: 'Mgr' },
|
||||||
{ materialCode: 'M2', managerName: 'Other' }
|
{ materialCode: 'M2', managerName: 'Other' }
|
||||||
@@ -347,7 +345,8 @@ describe('ValidationApplicationService', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
it('should handle errors gracefully', async () => {
|
it('should handle errors gracefully', async () => {
|
||||||
const { createValidationDatabaseService } = await import('../../../../src/main/services/validation/validation-database')
|
const { createValidationDatabaseService } =
|
||||||
|
await import('../../../../src/main/services/validation/validation-database')
|
||||||
vi.mocked(createValidationDatabaseService).mockRejectedValueOnce(new Error('DB down'))
|
vi.mocked(createValidationDatabaseService).mockRejectedValueOnce(new Error('DB down'))
|
||||||
|
|
||||||
const userInfo = { id: 1, username: 'admin', userType: 'Admin' } as any
|
const userInfo = { id: 1, username: 'admin', userType: 'Admin' } as any
|
||||||
|
|||||||
Reference in New Issue
Block a user