aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cypress/e2e/pages/blog.cy.ts
diff options
context:
space:
mode:
authorArmand Philippot <git@armandphilippot.com>2023-11-15 12:24:42 +0100
committerArmand Philippot <git@armandphilippot.com>2023-11-15 17:26:16 +0100
commit0f38aee374029213a47ef7c29bd164093fe63c85 (patch)
tree290cb6471fdfe81e4c42f4da4729247536b04ee7 /tests/cypress/e2e/pages/blog.cy.ts
parentbe4d907efb4e2fa658baa7c9b276ed282eb920db (diff)
refactor(hooks): remove useSettings hook
It does not make sense to re-export an existing object through a hook. On some pages both the hook and the object was imported... It is better to use the CONFIG (previously settings) object directly and by doing it we avoid potential errors because of conditional hooks.
Diffstat (limited to 'tests/cypress/e2e/pages/blog.cy.ts')
-rw-r--r--tests/cypress/e2e/pages/blog.cy.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/cypress/e2e/pages/blog.cy.ts b/tests/cypress/e2e/pages/blog.cy.ts
index 2ec14c2..3a422d2 100644
--- a/tests/cypress/e2e/pages/blog.cy.ts
+++ b/tests/cypress/e2e/pages/blog.cy.ts
@@ -1,4 +1,4 @@
-import { settings } from '../../../../src/utils/config';
+import { CONFIG } from '../../../../src/utils/config';
import { ROUTES } from '../../../../src/utils/constants';
type ArticlesGroup = {
@@ -27,10 +27,10 @@ describe('Blog Page', () => {
: { first: '0', total: '0' };
const totalArticles = parseInt(total, 10);
- expect(parseInt(first, 10)).to.be.within(1, settings.postsPerPage);
+ expect(parseInt(first, 10)).to.be.within(1, CONFIG.postsPerPage);
expect(totalArticles).to.be.at.least(1);
- const totalPages = Math.ceil(totalArticles / settings.postsPerPage);
+ const totalPages = Math.ceil(totalArticles / CONFIG.postsPerPage);
const remainingPages = totalPages - 1;
return Array.from({ length: remainingPages }, (_, i) => i + 1);