Skip to content

Commit

Permalink
add posts['docs'] instead of mock data
Browse files Browse the repository at this point in the history
  • Loading branch information
reachaadrika committed Jul 18, 2023
1 parent c6d73dd commit 0d63206
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions cypress/test/lib/api.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,8 @@ describe('getPostBySlug', () => {

describe('getDocBySlug', () => {
it('should return the document with the given slug', () => {
const structuredPosts = [
{ slug: 'doc1', isSection: false },
{ slug: 'doc2', isSection: false },
{ slug: 'doc3', isSection: false }
];
const slug = 'doc2';
const structuredPosts = posts['docs']
const slug = '/docs/concepts';
const doc = getDocBySlug(structuredPosts, slug);
const expectedDoc = structuredPosts.find((post) => post.slug === slug && !post.isSection);
expect(doc).to.deep.equal(expectedDoc);
Expand Down

0 comments on commit 0d63206

Please sign in to comment.