Skip to content

Commit e90d361

Browse files
authored
Fix validation checks for social links and resources
Signed-off-by: John Aerial J. Azcune <65322242+STICKnoLOGIC@users.noreply.github.com>
1 parent 9408df0 commit e90d361

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/json.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ async function processFile(file, t) {
162162

163163
// social validation
164164
if (data.social) {
165-
t.false(Object.keys(data.social) <= 5, `${file}: Maximum of 5 social links allowed`);
165+
t.true(Object.keys(data.social).length <= 5, `${file}: Maximum of 5 social links allowed`);
166166
for (const key of Object.keys(data.social)) {
167167
t.true(typeof data.social[key] === "string", `${file}: social.${key} should be a string`);
168168
t.true(data.social[key].startsWith("http"), `${file}: social.${key} should be a valid URL`);
@@ -171,7 +171,7 @@ async function processFile(file, t) {
171171

172172
//my_top_resources validation
173173
if (data.my_top_resources) {
174-
t.false(Object.keys(data.my_top_resources).length <= 3, `${file}: Maximum of 3 my_top_resources allowed`);
174+
t.true(Object.keys(data.my_top_resources).length <= 3, `${file}: Maximum of 3 my_top_resources allowed`);
175175
for (const key of Object.keys(data.my_top_resources)) {
176176
t.true(typeof data.my_top_resources[key] === "string", `${file}: my_top_resources.${key} should be a string`);
177177
t.true(data.my_top_resources[key].startsWith("http"), `${file}: my_top_resources.${key} should be a valid URL`);

0 commit comments

Comments
 (0)