Truncate a string - Why does this fail the last test?

Truncate a string - Why does this fail the last test?
0.0 0

#1

Why does this pass all of the tests except “truncateString(“Absolutely Longer”, 2) should return “Ab…”.”?

function truncateString(str, num) {
  if (num >= str.length) {
    return str;
  } else if (str.length <= 3){
    strSlice = str.slice(0, num);
  shortString = strSlice + "...";

  return shortString;
  }
     else {
  
  strSlice = str.slice(0, num - 3);
  truncatedString = strSlice + "...";

  return truncatedString;
  }
}

truncateString("Peter Piper picked a peck of pickled peppers", 14);

#2

In this case you should check num maybe, not str.length

if (str.length <= 3)