-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(tests): Add more Unit tests #5364
base: master
Are you sure you want to change the base?
Conversation
|
||
const formatted = notification.format(msg); | ||
assert.ok(formatted.includes("Test Monitor"), "Should include monitor name"); | ||
assert.ok(formatted.includes("https://test.mydomain.com"), "Should include full URL"); |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High test
https://test.mydomain.com
}; | ||
|
||
const maliciousFormatted = notification.format(maliciousMsg); | ||
assert.ok(!maliciousFormatted.includes("test.mydomain.com"), "Should not include test.mydomain.com as substring"); |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High test
test.mydomain.com
|
||
const maliciousFormatted = notification.format(maliciousMsg); | ||
assert.ok(!maliciousFormatted.includes("test.mydomain.com"), "Should not include test.mydomain.com as substring"); | ||
assert.ok(maliciousFormatted.includes("https://malicious.mydomain.com"), "Should include exact malicious URL"); |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High test
https://malicious.mydomain.com
}; | ||
const upFormatted = notification.format(upMsg); | ||
assert.ok(upFormatted.includes("up"), "Should indicate UP status"); | ||
assert.ok(upFormatted.includes("https://test1.mydomain.com"), "Should include complete URL"); |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High test
https://test1.mydomain.com
}; | ||
const downFormatted = notification.format(downMsg); | ||
assert.ok(downFormatted.includes("down"), "Should indicate DOWN status"); | ||
assert.ok(downFormatted.includes("https://test2.mydomain.com"), "Should include complete URL"); |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High test
https://test2.mydomain.com
I don't know why the backend-test failing I found no error in it still fails. Needs to look into it. |
When checking the url, I think you should parse into a URL by using |
Ohh that could work i will look into into it! |
This reverts commit 76ee06a.
060cc5b
to
030ff79
Compare
…into more-tests
- All DNS record types - Various DNS providers - Edge cases and error conditions - Response format validation - Performance metrics - Security validations
- Better test organization - More comprehensive coverage - Improved error handling - Better async cleanup - More realistic test scenarios
…into more-tests
} | ||
|
||
// Check for potential URL substring issues | ||
if (testCase.url.includes("test.mydomain.com")) { |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization High test
test.mydomain.com
Will pick up this PR soon and complete it. |
https://github.com/louislam/uptime-kuma/blob/master/CONTRIBUTING.md#can-i-create-a-pull-request-for-uptime-kuma
Tick the checkbox if you understand [x]:
Description
Add more Tests tests might get failed
Type of change
Please delete any options that are not relevant.
Checklist
Screenshots (if any)
Please do not use any external image service. Instead, just paste in or drag and drop the image here, and it will be uploaded automatically.