Skip to content

Commit 09900f9

Browse files
Agnieszka SzubaAgnieszka Szuba
authored andcommitted
Adjust full text tests and keyword density tests
1 parent 6491287 commit 09900f9

File tree

4 files changed

+8
-11
lines changed

4 files changed

+8
-11
lines changed

packages/yoastseo/spec/fullTextTests/testTexts/cs/czechPaper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const expectedResults = {
3333
isApplicable: true,
3434
score: 4,
3535
resultText: "<a href='https://yoa.st/33v' target='_blank'>Keyphrase density</a>: The keyphrase was found 9 times. " +
36-
"That's less than the recommended minimum of 12 times for a text of this length. <a href='https://yoa.st/33w' " +
36+
"That's less than the recommended minimum of 13 times for a text of this length. <a href='https://yoa.st/33w' " +
3737
"target='_blank'>Focus on your keyphrase</a>!",
3838
},
3939
metaDescriptionKeyword: {

packages/yoastseo/spec/fullTextTests/testTexts/nl/dutchPaper.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,8 @@ const expectedResults = {
5454
},
5555
textCompetingLinks: {
5656
isApplicable: true,
57-
score: 2,
58-
resultText: "<a href='https://yoa.st/34l' target='_blank'>Link keyphrase</a>: " +
59-
"You're linking to another page with the words you want this page to rank for. " +
60-
"<a href='https://yoa.st/34m' target='_blank'>Don't do that</a>!",
57+
score: 0,
58+
resultText: "",
6159
},
6260
textLength: {
6361
isApplicable: true,

packages/yoastseo/spec/fullTextTests/testTexts/pt/portuguesePaper.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ const expectedResults = {
5555
},
5656
textCompetingLinks: {
5757
isApplicable: true,
58-
score: 2,
59-
resultText: "<a href='https://yoa.st/34l' target='_blank'>Link keyphrase</a>: You're linking to another page with the words you want this " +
60-
"page to rank for. <a href='https://yoa.st/34m' target='_blank'>Don't do that</a>!",
58+
score: 0,
59+
resultText: "",
6160
},
6261
textLength: {
6362
isApplicable: true,

packages/yoastseo/spec/languageProcessing/researches/getKeywordDensitySpec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe( "Test for counting the keyword density in a text with an English resea
4343
const mockResearcher = new EnglishResearcher( mockPaper );
4444
mockResearcher.addResearchData( "morphology", morphologyDataEN );
4545
buildTree( mockPaper, mockResearcher );
46-
expect( getKeywordDensity( mockPaper, new EnglishResearcher( mockPaper ) ) ).toBe( 9.090909090909092 );
46+
expect( getKeywordDensity( mockPaper, new EnglishResearcher( mockPaper ) ) ).toBe( 16.666666666666664 );
4747
} );
4848

4949
it( "should recognize a keyphrase with an underscore in it", function() {
@@ -65,7 +65,7 @@ describe( "Test for counting the keyword density in a text with an English resea
6565
const mockResearcher = new EnglishResearcher( mockPaper );
6666

6767
buildTree( mockPaper, mockResearcher );
68-
expect( getKeywordDensity( mockPaper, new EnglishResearcher( mockPaper ) ) ).toBe( 7.6923076923076925 );
68+
expect( getKeywordDensity( mockPaper, new EnglishResearcher( mockPaper ) ) ).toBe( 7.142857142857142 );
6969
} );
7070

7171
it( "should recognize a keyphrase with an ampersand in it", function() {
@@ -114,7 +114,7 @@ describe( "Test for counting the keyword density in a text with an English resea
114114
const mockPaper = new Paper( "<p>a string with non-breaking space to match the key&nbsp;word</p>", { keyword: "key word" } );
115115
const mockResearcher = new EnglishResearcher( mockPaper );
116116
buildTree( mockPaper, mockResearcher );
117-
expect( getKeywordDensity( mockPaper, new EnglishResearcher( mockPaper ) ) ).toBe( 10 );
117+
expect( getKeywordDensity( mockPaper, new EnglishResearcher( mockPaper ) ) ).toBe( 9.090909090909092 );
118118
} );
119119
it( "should return 0 when the paper contains only excluded element", function() {
120120
const mockPaper = new Paper( "<blockquote>In the United States and parts of Europe, " +

0 commit comments

Comments
 (0)