DEV Community

AjeaS
AjeaS

Posted on

2 3

Self-documentation of Hire +Plus: V1 (5)

What I cover

  • Testing for Launch page
  • Testing for Auth page

Testing Launch page

I made a few changes to the launch.spec.js test file. Here's what it looks like now

describe('Launch Page', () => {
    before(() => {
        cy.visit('http://localhost:3000');
    });
    it('renders the launch page', () => {
        cy.contains('For Employers');
    });
    it('redirect to auth page', () => {
        cy.contains('GET STARTED').click();

        cy.url().should('include', '/auth');
    });
});
Enter fullscreen mode Exit fullscreen mode

Created a test for Auth page

auth.spec.js test file has simple tests to ensure the correct components are rendering when a user routes to the auth/employees and auth/employer routes.

describe('Authentication for employees', () => {
    before(() => {
        cy.visit('http://localhost:3000/auth/employees');
    });
    it('should show the login component', () => {
        cy.contains('Already have an account?');
    });
    it('should show the sign up component', () => {
        cy.contains("Don't have an account?");
    });
});
describe('Authentication for employer', () => {
    before(() => {
        cy.visit('http://localhost:3000/auth/employer');
    });
    it('should show the login component', () => {
        cy.contains('Already have an account?');
    });
    it('should show the sign up component', () => {
        cy.contains("Don't have an account?");
    });
});
Enter fullscreen mode Exit fullscreen mode

That's all for now. Stay tuned for more. View the source code here.

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay