-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: DA Automation <[email protected]> Co-authored-by: DA Automation <[email protected]>
- Loading branch information
1 parent
e470459
commit d6b6c16
Showing
35 changed files
with
2,308 additions
and
506 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) 2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import { screen } from '@testing-library/react'; | ||
import { expect } from 'vitest'; | ||
|
||
export function checkAmuletRulesExpectedConfigDiffsHTML( | ||
mockHtmlContent: string, | ||
expectedNumberOfInFlightDiffs: number = 0 // useful when we unfold the diffs | ||
): void { | ||
const htmlContents = screen.getAllByTestId('config-diffs-display'); | ||
if (expectedNumberOfInFlightDiffs > 0) { | ||
expect(screen.getAllByTestId('folded-accordion')).toHaveLength(expectedNumberOfInFlightDiffs); | ||
} else { | ||
expect(screen.queryByTestId('folded-accordion')).toBeNull(); | ||
} | ||
expect(htmlContents[0].innerHTML).toBe(mockHtmlContent); | ||
} | ||
|
||
export function checkDsoRulesExpectedConfigDiffsHTML( | ||
mockHtmlContent: string, | ||
expectedNumberOfInFlightDiffs: number = 0 | ||
): void { | ||
const htmlContents = screen.getAllByTestId('config-diffs-display'); | ||
if (expectedNumberOfInFlightDiffs > 0) { | ||
expect(screen.getAllByTestId('folded-accordion')).toHaveLength(expectedNumberOfInFlightDiffs); | ||
} else { | ||
expect(screen.queryByTestId('folded-accordion')).toBeNull(); | ||
} | ||
expect(htmlContents[0].innerHTML).toBe(mockHtmlContent); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
export { validatorLicensesHandler } from './mocks/handlers/validator-licenses-handler'; | ||
export { dsoInfoHandler, dsoInfo } from './mocks/handlers/dso-info-handler'; | ||
export { dsoInfoHandler, dsoInfo, getAmuletConfig } from './mocks/handlers/dso-info-handler'; | ||
export { | ||
checkAmuletRulesExpectedConfigDiffsHTML, | ||
checkDsoRulesExpectedConfigDiffsHTML, | ||
} from './configDiffs'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.