-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
CYF-ITP - South Africa | Simphiwe Mabuya | Structuring-and-Testing-Data | Sprint-3 #215
base: main
Are you sure you want to change the base?
CYF-ITP - South Africa | Simphiwe Mabuya | Structuring-and-Testing-Data | Sprint-3 #215
Conversation
This reverts commit 7c6d5f1.
…moving Math.sqrt from the loop
Greetings Mr CJ...I have been doing that actually, it's just that the
session I was replying to on GitHub refreshed and I lost it.
I now have the choice to reply from this email thread I guess.
I replied to our "conversation" up to :
Sprint-3/implement/is-valid-triangle.js
<#215 (comment)>
from our "conversation" on GitHub.
In Sprint-3/revise/implement/card-validator.test.js
<#215 (comment)>:
I have refactored my code to clean and wrote tests to check for: "Check if
the number has 16 digits", "Checks if the sum of all numbers is greater
than 16" and "Checks if at least two different digits are represented".
In Sprint-3/revise/implement/is-prime.test.js
<#215 (comment)>:
Refactored code to look clean and tested for large prime and non-prime
numbers.
I also tried to improve the performance of the code by following your
suggestions:
- - Check if num is 2, and check only odd numbers >= 3 in the loop
- - Avoid calling Math.sqrt(num) repeatedly by assigning the value of
Math.sqrt(num) to a variable once, and then refer to the variable in the
condition of the loop.
In Sprint-3/revise/implement/password-validator.test.js
<#215 (comment)>:
I've added a lower case letter here to check if the test will return false
and it does. I am not sure if I followed you well on this point ..? I
thought this test was to check if the password has at least five
characters.
I've also refactored the test to look clean plus have the test to check if
the function can detect an invalid password that misses only one of the
following conditions :
- Have at least one English uppercase letter (A-Z)
- Have at least one English lowercase letter (a-z)
- Have at least one number (0-9)
- Have at least one of the following non-alphanumeric symbols: ("!",
"#", "$", "%", ".", "*", "&")
In Sprint-3/revise/investigate/find.js
<#215 (comment)>:
I also updated my answers after I followed your advice by using ChatGpt.
I believe my answers should now be correct.
I trust that I've managed to answer and rectify all the items you have
identified.
Looking forward to your constructive feedback again.
Enjoy the rest of the evening.
Best regards
Simphiwe Mabuya
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
…On Tue, 3 Dec 2024 at 20:15, CJ Yuan ***@***.***> wrote:
Can you reply my comments in the "conversation" that appear in the changed
code directly, so that I know what changes you have made (without going
through all the files)? The bug I mentioned in one of my comments is still
in your code.
—
Reply to this email directly, view it on GitHub
<#215 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BIXBQLNLKENJN52Y66OC6RT2DXYLBAVCNFSM6AAAAABS3NMRN6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJVGI3TANZZGA>
.
You are receiving this because you authored the thread.Message ID:
<CodeYourFuture/Module-Structuring-and-Testing-Data/pull/215/c2515270790@
github.com>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I let you new comments.
@@ -6,6 +6,21 @@ | |||
// When the function getAngleType is called with this angle, | |||
// Then it should: | |||
|
|||
function getAngleType(degrees) { | |||
if (degrees === 90) return "Right angle"; | |||
if (degrees < 90) return "Acute angle"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you expect getAngleType(-5)
to return?
}); | ||
|
||
|
||
test("Expect 'Reflect angle' when 180 < angle < 360", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was just making a suggestion so that you can try to keep the test description concise in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tip CJ ..I thought it was best I used it.
@@ -2,6 +2,37 @@ | |||
|
|||
// You will need to implement a function getCardValue | |||
|
|||
function getCardValue(cardRank){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getCardValue("10000♣")
would still break your implementation. (sorry)
The card value should always have ONE suite character as the LAST character. So
getCardValue("10")
should return 'Invalid card rank'
.
Since there are exactly 13 valid ranks but countless possible invalid ranks,
it would be easier to consider what value constitutes a valid rank
instead of considering what values are invalid.
After you have checked all valid cases, everything else would be invalid.
Sprint-3/implement/get-card-value.js
Outdated
@@ -2,6 +2,37 @@ | |||
|
|||
// You will need to implement a function getCardValue | |||
|
|||
function getCardValue(cardRank){ | |||
|
|||
if(cardRank === "10"){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can remove the suite character from cardRank
first, this is a good way to guarantee the return value is correct.
Sprint-3/implement/get-card-value.js
Outdated
return 10; | ||
} | ||
|
||
if(/^0\d/.test(cardRank) || /\.\d/.test(cardRank)){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can skip checking for possible invalid cases.
Sprint-3/implement/get-card-value.js
Outdated
return "Invalid card rank"; | ||
} | ||
|
||
cardRank = cardRank.slice(0, 2) === "10" ? "10" : cardRank.slice(0, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part should be replaced by a statement that removes the suite character from the string, and should be perform at the beginning of the function.
|
||
|
||
test("Checks if the number has 16 digits.", () => { | ||
expect(cardValidator("1243578569873476")).toEqual(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function can successfully check if there are 16 digits in the card number does not mean that the function can return false when the card number has 15 or 20 digits.
Similarly, you should also test if the function can return false
when
- the card number do not have "at least two different digits"
- the sum of the digits is less than or equal 16
In addition to these tests, there are another two tests you could have to make your test more comprehensive.
@@ -0,0 +1,22 @@ | |||
function isPrime(num){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not design the function to return true
or false
to indicate if the given number is a prime?
|
||
test('Checks if password has at least one English uppercase letter (A-Z)', () => { | ||
const passwords =[]; | ||
expect(passwordValidator("Bad@11.#YoZ%", passwords)).toBe(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When given a valid password, the function can correctly return true. (This is what your test represents)
When given an invalid password, can the function correctly return false? (This is what I would like you to test)
For examples, a password missing only a digit, a password missing only an alphanumeric character, etc.
If you prepare the tests correctly, you may discover the bug in your code.
} | ||
|
||
if(passwords.includes(password)){ | ||
return "Password is already used" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to return false
to make the return value consistent.
Good morning CJ
Thanks a lot for your feedback as always..it looks like I’ve got some work
to do.
Let me get on it and get back to you as soon as I can.
Best regards
Simphiwe Mabuya
…On Wed, 04 Dec 2024 at 03:21, CJ Yuan ***@***.***> wrote:
***@***.**** commented on this pull request.
I let you new comments.
------------------------------
In Sprint-3/implement/get-angle-type.js
<#215 (comment)>
:
> @@ -6,6 +6,21 @@
// When the function getAngleType is called with this angle,
// Then it should:
+function getAngleType(degrees) {
+ if (degrees === 90) return "Right angle";
+ if (degrees < 90) return "Acute angle";
What do you expect getAngleType(-5) to return?
------------------------------
In Sprint-3/implement/get-angle-type.test.js
<#215 (comment)>
:
> +test("Checks for Acute angle, when the angle < 90 degrees", () => {
+ expect(getAngleType(45)).toEqual("Acute angle");
+});
+
+
+test("Checks for Obtuse angle, when the angle > 90 and angle < 180 degrees", () => {
+ expect(getAngleType(145)).toEqual("Obtuse angle");
+});
+
+
+test("Checks for Straight angle, when the angle is exactly 180 degrees", () => {
+ expect(getAngleType(180)).toEqual("Straight angle");
+});
+
+
+test("Expect 'Reflect angle' when 180 < angle < 360", () => {
I was just making a suggestion so that you can try to keep the test
description concise in the future.
------------------------------
In Sprint-3/implement/get-card-value.js
<#215 (comment)>
:
> @@ -2,6 +2,37 @@
// You will need to implement a function getCardValue
+function getCardValue(cardRank){
getCardValue("10000♣") would still break your implementation. (sorry)
The card value should always have ONE suite character as the LAST
character. So
getCardValue("10") should return 'Invalid card rank'.
Since there are exactly 13 valid ranks but countless possible invalid
ranks,
it would be easier to consider what value constitutes a valid rank
instead of considering what values are invalid.
After you have checked all valid cases, everything else would be invalid.
------------------------------
In Sprint-3/implement/get-card-value.js
<#215 (comment)>
:
> @@ -2,6 +2,37 @@
// You will need to implement a function getCardValue
+function getCardValue(cardRank){
+
+ if(cardRank === "10"){
If you can remove the suite character from cardRank first, this is a good
way to guarantee the return value is correct.
------------------------------
In Sprint-3/implement/get-card-value.js
<#215 (comment)>
:
> @@ -2,6 +2,37 @@
// You will need to implement a function getCardValue
+function getCardValue(cardRank){
+
+ if(cardRank === "10"){
+ return 10;
+ }
+
+ if(/^0\d/.test(cardRank) || /\.\d/.test(cardRank)){
You can skip checking for possible invalid cases.
------------------------------
In Sprint-3/implement/get-card-value.js
<#215 (comment)>
:
> + }
+
+ if(/^0\d/.test(cardRank) || /\.\d/.test(cardRank)){
+ return "Invalid card rank";
+ }
+
+ cardRank = cardRank.slice(0, 2) === "10" ? "10" : cardRank.slice(0, 1);
+
+ if(cardRank ==="A"){
+ return 11;
+ }else if(cardRank === "J" || cardRank === "K" || cardRank === "Q"){
+ return 10;
+ }
+
+ const numericalValue = parseInt(cardRank, 10);
+ if(numericalValue >= 2 && numericalValue <= 10){
You have already checked for "10" at line 7. So the remaining values to be
checked are "2", "3", ..., "9". What do these strings have in common? What
condition can you add so that ranks like "2.1" would not pass the check.
------------------------------
In Sprint-3/implement/get-card-value.js
<#215 (comment)>
:
> @@ -2,6 +2,37 @@
// You will need to implement a function getCardValue
+function getCardValue(cardRank){
+
+ if(cardRank === "10"){
+ return 10;
+ }
+
+ if(/^0\d/.test(cardRank) || /\.\d/.test(cardRank)){
+ return "Invalid card rank";
+ }
+
+ cardRank = cardRank.slice(0, 2) === "10" ? "10" : cardRank.slice(0, 1);
This part should be replaced by a statement that removes the suite
character from the string, and should be perform at the beginning of the
function.
------------------------------
In Sprint-3/revise/implement/card-validator.test.js
<#215 (comment)>
:
> @@ -0,0 +1,23 @@
+
+const cardValidator = require("./cardValidator");
+
+
+test("Checks if the number has 16 digits.", () => {
+ expect(cardValidator("1243578569873476")).toEqual(true)
The function can successfully check if there are 16 digits in the card
number does not mean that the function can return false when the card
number has 15 or 20 digits.
------------------------------
In Sprint-3/revise/implement/isPrime.js
<#215 (comment)>
:
> @@ -0,0 +1,22 @@
+function isPrime(num){
Why not design the function to return true or false to indicate if the
given number is a prime?
------------------------------
In Sprint-3/revise/implement/password-validator.test.js
<#215 (comment)>
:
> @@ -14,3 +14,36 @@ To be valid, a password must:
You must breakdown this problem in order to solve it. Find one test case first and get that working
*/
+
+const passwordValidator = require("./passwordValidator");
+
+
+test('Checks if password has at least one English uppercase letter (A-Z)', () => {
+ const passwords =[];
+ ***@***.***#YoZ%", passwords)).toBe(true);
When given a valid password, the function can correctly return true. (This
is what your test represents)
When given an invalid password, can the function correctly return false?
(This is what I would like you to test)
For examples, a password missing only a digit, a password missing only an
alphanumeric character, etc.
If you prepare the tests correctly, you may discover the bug in your code.
------------------------------
In Sprint-3/revise/implement/passwordValidator.js
<#215 (comment)>
:
> @@ -0,0 +1,28 @@
+function passwordValidator(password, passwords){
+
+ if(password.length < 5){
+ return false;
+ }
+
+ if(passwords.includes(password)){
+ return "Password is already used"
Better to return false to make the return value consistent.
—
Reply to this email directly, view it on GitHub
<#215 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BIXBQLNJCVDSVSL3OJKOWND2DZKIHAVCNFSM6AAAAABS3NMRN6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDINZXGAYDANBUGQ>
.
You are receiving this because you authored the thread.Message ID:
<CodeYourFuture/Module-Structuring-and-Testing-Data/pull/215/review/2477000444
@github.com>
|
…ime" or "is not prime"
…a digit/an alphanumeric character
…" for consistency reasons
Greetings CJ again
I hope this finds you well this afternoon.
Here are my solutions as per your directions/feedback:
In Sprint-3/implement/get-angle-type.js
<#215 (comment)>:
I expect getAngleType(-5) to return 'Acute Angle' because -5 is less than
90 (-5 < 90)
In Sprint-3/implement/get-card-value.js
<#215 (comment)>:
- I believe I've managed to check all valid cases are working and have
checked everything else
would be invalid..eg "10", "2.1", "Z", "10000 ♣ " etc
- I also made sure to remove the suite character from cardRank first right
from the start.
- Also I made sure to skip checking for possible invalid cases with regex.
- I also made sure that my code checks for "2", "3", ..., "9" ...and the
thing that's common with these strings is that they are all. I used
'numericalValue.toString() === cardRank' to make sure "2.1" does not pass.
In Sprint-3/revise/implement/card-validator.test.js
<#215 (comment)>:
- I've updated my test to check for the card number when it's less than 16
or greater (15 / 20 ) and returns false if so.
In Sprint-3/revise/implement/isPrime.js
<#215 (comment)>:
I've updated the function to return true or false to indicate if the given
number is a prime or not as advised.
In Sprint-3/revise/implement/password-validator.test.js
<#215 (comment)>:
Also updated my password-validator test to check for when the password is
missing only a digit or only an alphanumeric character and to return false
if so.
In Sprint-3/revise/implement/passwordValidator.js
<#215 (comment)>:
and lastly I've updated the function to return false istead of "Password
already used" to make the return value consistent.
Thanks a million yet again CJ for your constructive feedback, looking
forward to hearing from you again.
Please do enjoy the rest of the day.
Best regards
Simphiwe Mabuya
…On Wed, 4 Dec 2024 at 09:48, Simphiwe Mabuya ***@***.***> wrote:
Good morning CJ
Thanks a lot for your feedback as always..it looks like I’ve got some work
to do.
Let me get on it and get back to you as soon as I can.
Best regards
Simphiwe Mabuya
On Wed, 04 Dec 2024 at 03:21, CJ Yuan ***@***.***> wrote:
> ***@***.**** commented on this pull request.
>
> I let you new comments.
> ------------------------------
>
> In Sprint-3/implement/get-angle-type.js
> <#215 (comment)>
> :
>
> > @@ -6,6 +6,21 @@
> // When the function getAngleType is called with this angle,
> // Then it should:
>
> +function getAngleType(degrees) {
> + if (degrees === 90) return "Right angle";
> + if (degrees < 90) return "Acute angle";
>
> What do you expect getAngleType(-5) to return?
> ------------------------------
>
> In Sprint-3/implement/get-angle-type.test.js
> <#215 (comment)>
> :
>
> > +test("Checks for Acute angle, when the angle < 90 degrees", () => {
> + expect(getAngleType(45)).toEqual("Acute angle");
> +});
> +
> +
> +test("Checks for Obtuse angle, when the angle > 90 and angle < 180 degrees", () => {
> + expect(getAngleType(145)).toEqual("Obtuse angle");
> +});
> +
> +
> +test("Checks for Straight angle, when the angle is exactly 180 degrees", () => {
> + expect(getAngleType(180)).toEqual("Straight angle");
> +});
> +
> +
> +test("Expect 'Reflect angle' when 180 < angle < 360", () => {
>
> I was just making a suggestion so that you can try to keep the test
> description concise in the future.
> ------------------------------
>
> In Sprint-3/implement/get-card-value.js
> <#215 (comment)>
> :
>
> > @@ -2,6 +2,37 @@
>
> // You will need to implement a function getCardValue
>
> +function getCardValue(cardRank){
>
> getCardValue("10000♣") would still break your implementation. (sorry)
>
> The card value should always have ONE suite character as the LAST
> character. So
> getCardValue("10") should return 'Invalid card rank'.
>
> Since there are exactly 13 valid ranks but countless possible invalid
> ranks,
> it would be easier to consider what value constitutes a valid rank
> instead of considering what values are invalid.
> After you have checked all valid cases, everything else would be invalid.
> ------------------------------
>
> In Sprint-3/implement/get-card-value.js
> <#215 (comment)>
> :
>
> > @@ -2,6 +2,37 @@
>
> // You will need to implement a function getCardValue
>
> +function getCardValue(cardRank){
> +
> + if(cardRank === "10"){
>
> If you can remove the suite character from cardRank first, this is a
> good way to guarantee the return value is correct.
> ------------------------------
>
> In Sprint-3/implement/get-card-value.js
> <#215 (comment)>
> :
>
> > @@ -2,6 +2,37 @@
>
> // You will need to implement a function getCardValue
>
> +function getCardValue(cardRank){
> +
> + if(cardRank === "10"){
> + return 10;
> + }
> +
> + if(/^0\d/.test(cardRank) || /\.\d/.test(cardRank)){
>
> You can skip checking for possible invalid cases.
> ------------------------------
>
> In Sprint-3/implement/get-card-value.js
> <#215 (comment)>
> :
>
> > + }
> +
> + if(/^0\d/.test(cardRank) || /\.\d/.test(cardRank)){
> + return "Invalid card rank";
> + }
> +
> + cardRank = cardRank.slice(0, 2) === "10" ? "10" : cardRank.slice(0, 1);
> +
> + if(cardRank ==="A"){
> + return 11;
> + }else if(cardRank === "J" || cardRank === "K" || cardRank === "Q"){
> + return 10;
> + }
> +
> + const numericalValue = parseInt(cardRank, 10);
> + if(numericalValue >= 2 && numericalValue <= 10){
>
> You have already checked for "10" at line 7. So the remaining values to
> be checked are "2", "3", ..., "9". What do these strings have in common?
> What condition can you add so that ranks like "2.1" would not pass the
> check.
> ------------------------------
>
> In Sprint-3/implement/get-card-value.js
> <#215 (comment)>
> :
>
> > @@ -2,6 +2,37 @@
>
> // You will need to implement a function getCardValue
>
> +function getCardValue(cardRank){
> +
> + if(cardRank === "10"){
> + return 10;
> + }
> +
> + if(/^0\d/.test(cardRank) || /\.\d/.test(cardRank)){
> + return "Invalid card rank";
> + }
> +
> + cardRank = cardRank.slice(0, 2) === "10" ? "10" : cardRank.slice(0, 1);
>
> This part should be replaced by a statement that removes the suite
> character from the string, and should be perform at the beginning of the
> function.
> ------------------------------
>
> In Sprint-3/revise/implement/card-validator.test.js
> <#215 (comment)>
> :
>
> > @@ -0,0 +1,23 @@
> +
> +const cardValidator = require("./cardValidator");
> +
> +
> +test("Checks if the number has 16 digits.", () => {
> + expect(cardValidator("1243578569873476")).toEqual(true)
>
> The function can successfully check if there are 16 digits in the card
> number does not mean that the function can return false when the card
> number has 15 or 20 digits.
> ------------------------------
>
> In Sprint-3/revise/implement/isPrime.js
> <#215 (comment)>
> :
>
> > @@ -0,0 +1,22 @@
> +function isPrime(num){
>
> Why not design the function to return true or false to indicate if the
> given number is a prime?
> ------------------------------
>
> In Sprint-3/revise/implement/password-validator.test.js
> <#215 (comment)>
> :
>
> > @@ -14,3 +14,36 @@ To be valid, a password must:
>
> You must breakdown this problem in order to solve it. Find one test case first and get that working
> */
> +
> +const passwordValidator = require("./passwordValidator");
> +
> +
> +test('Checks if password has at least one English uppercase letter (A-Z)', () => {
> + const passwords =[];
> + ***@***.***#YoZ%", passwords)).toBe(true);
>
> When given a valid password, the function can correctly return true.
> (This is what your test represents)
>
> When given an invalid password, can the function correctly return false?
> (This is what I would like you to test)
> For examples, a password missing only a digit, a password missing only an
> alphanumeric character, etc.
>
> If you prepare the tests correctly, you may discover the bug in your code.
> ------------------------------
>
> In Sprint-3/revise/implement/passwordValidator.js
> <#215 (comment)>
> :
>
> > @@ -0,0 +1,28 @@
> +function passwordValidator(password, passwords){
> +
> + if(password.length < 5){
> + return false;
> + }
> +
> + if(passwords.includes(password)){
> + return "Password is already used"
>
> Better to return false to make the return value consistent.
>
> —
> Reply to this email directly, view it on GitHub
> <#215 (review)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/BIXBQLNJCVDSVSL3OJKOWND2DZKIHAVCNFSM6AAAAABS3NMRN6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDINZXGAYDANBUGQ>
> .
> You are receiving this because you authored the thread.Message ID:
> <CodeYourFuture/Module-Structuring-and-Testing-Data/pull/215/review/2477000444
> @github.com>
>
|
The tests in For a certain kind of invalid passwords, your current function is returning |
Alright 😁 ..this is going to be an interesting yet challenging one.
Thanks a lot again CJ for such s speedy response 🙏🏾🙏🏾
Let me get on it and get back to you as soon as possible.
…On Wed, 04 Dec 2024 at 19:15, CJ Yuan ***@***.***> wrote:
The tests in Sprint-3/revise/implement/password-validator.test.js are
still not comprehensive enough to detect the bug in your function.
For a certain kind of invalid passwords, your current function is
returning true instead of false. If you cannot figure out which test
cases you missed or find the bug in your code, you can test different kinds
of invalid passwords to see which kind of invalid passwords your function
cannot detect.
—
Reply to this email directly, view it on GitHub
<#215 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BIXBQLORVPT4A3OAXEGYAZD2D42C3AVCNFSM6AAAAABS3NMRN6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJYGA3DMMRWGY>
.
You are receiving this because you authored the thread.Message ID:
<CodeYourFuture/Module-Structuring-and-Testing-Data/pull/215/c2518066266@
github.com>
|
…ord doesn't have at least one uppercase or lowercase letter
…ne uppercase / lowercase letter
Evening CJ ..I trust that this will find you well.
I think I've found the bug in my code..the invalid password was a password
with only one uppercase / lowercase letter that returned true instead of
false. Thus I fixed my regex expression to check if the password has at
least one uppercase and one lowercase letter.
Looking forward to hearing your thoughts regarding my attempted solution.
Kind regards
Simphiwe Mabuya
…On Wed, 4 Dec 2024 at 20:13, Simphiwe Mabuya ***@***.***> wrote:
Alright 😁 ..this is going to be an interesting yet challenging one.
Thanks a lot again CJ for such s speedy response 🙏🏾🙏🏾
Let me get on it and get back to you as soon as possible.
On Wed, 04 Dec 2024 at 19:15, CJ Yuan ***@***.***> wrote:
> The tests in Sprint-3/revise/implement/password-validator.test.js are
> still not comprehensive enough to detect the bug in your function.
>
> For a certain kind of invalid passwords, your current function is
> returning true instead of false. If you cannot figure out which test
> cases you missed or find the bug in your code, you can test different kinds
> of invalid passwords to see which kind of invalid passwords your function
> cannot detect.
>
> —
> Reply to this email directly, view it on GitHub
> <#215 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/BIXBQLORVPT4A3OAXEGYAZD2D42C3AVCNFSM6AAAAABS3NMRN6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJYGA3DMMRWGY>
> .
> You are receiving this because you authored the thread.Message ID:
> <CodeYourFuture/Module-Structuring-and-Testing-Data/pull/215/c2518066266@
> github.com>
>
|
Greetings CJ ..
I am sure this will find you well.
I just wanted to confirm if my last answer was the final issue to resolve
and if it’s now safe to mark my PR complete?
Thanks a million as always and I’m looking forward to your feedback in the
near future.
Kind regards
Simphiwe Mabuya
…On Wed, 04 Dec 2024 at 23:05, Simphiwe Mabuya ***@***.***> wrote:
Evening CJ ..I trust that this will find you well.
I think I've found the bug in my code..the invalid password was a password
with only one uppercase / lowercase letter that returned true instead of
false. Thus I fixed my regex expression to check if the password has at
least one uppercase and one lowercase letter.
Looking forward to hearing your thoughts regarding my attempted solution.
Kind regards
Simphiwe Mabuya
On Wed, 4 Dec 2024 at 20:13, Simphiwe Mabuya ***@***.***> wrote:
> Alright 😁 ..this is going to be an interesting yet challenging one.
>
> Thanks a lot again CJ for such s speedy response 🙏🏾🙏🏾
>
> Let me get on it and get back to you as soon as possible.
>
> On Wed, 04 Dec 2024 at 19:15, CJ Yuan ***@***.***> wrote:
>
>> The tests in Sprint-3/revise/implement/password-validator.test.js are
>> still not comprehensive enough to detect the bug in your function.
>>
>> For a certain kind of invalid passwords, your current function is
>> returning true instead of false. If you cannot figure out which test
>> cases you missed or find the bug in your code, you can test different kinds
>> of invalid passwords to see which kind of invalid passwords your function
>> cannot detect.
>>
>> —
>> Reply to this email directly, view it on GitHub
>> <#215 (comment)>,
>> or unsubscribe
>> <https://github.com/notifications/unsubscribe-auth/BIXBQLORVPT4A3OAXEGYAZD2D42C3AVCNFSM6AAAAABS3NMRN6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMJYGA3DMMRWGY>
>> .
>> You are receiving this because you authored the thread.Message ID:
>> <CodeYourFuture/Module-Structuring-and-Testing-Data/pull/215/c2518066266
>> @github.com>
>>
>
|
Yes. All is good. |
Thanks a million CJ ..have a great day ahead.
…On Tue, 10 Dec 2024 at 04:15, CJ Yuan ***@***.***> wrote:
Yes. That's my confirmation.
—
Reply to this email directly, view it on GitHub
<#215 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BIXBQLPZSOT5QBRGCIYJXJL2EZFFNAVCNFSM6AAAAABS3NMRN6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKMZQGA2TKNBXGI>
.
You are receiving this because you authored the thread.Message ID:
<CodeYourFuture/Module-Structuring-and-Testing-Data/pull/215/c2530055472@
github.com>
|
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.