codeforpdx / PASS

PASS project - with HMIS module integration
MIT License
26 stars 25 forks source link

Issue 408 refactor signup page into smaller chunks #431

Closed bingeboy closed 9 months ago

bingeboy commented 10 months ago

Issue 408 refactor signup page into smaller chunks


This PR:

Resolves #408


The files this PR effects:

See Files Changed

Components

Signup.jsx Signup/Components/PodRegistrationForm.jsx Signup/Components/ShowNewPod.jsx

Tests

Added test for the PodRegistrationForm.test.jsx ShowNewPod.test,jsx seemed to be failing due to #420


Additional Context (optional):

Should act the same as what is currently in Development. The goal was to refactor the code. Please let me know any preferred naming conventions for the components or files.

bingeboy commented 9 months ago

@timbot1789 I think this is the test I mentioned on the call last night:

//React imports
import React from 'react';
import { render, screen } from '@testing-library/react';
import { BrowserRouter as Router } from 'react-router-dom';

// Testing imports
import { expect, it, describe } from 'vitest';

// Component being tested
import PodRegistrationForm from '../../../src/components/Signup/PodRegistrationForm';

describe('PodRegistrationForm', () => {
  it('Renders the PodRegistrationForm Component', () => {
    render(
        <Router>
          <PodRegistrationForm />
        </Router>
      );

    const textField = screen.getByLabelText('Email');
    const inputElementPassword = screen.getByLabelText('Password');
    const inputElementConfirmPassord = screen.getByLabelText('Confirm Password');

    expect(textField).to.equal('Email');
    expect(inputElementPassword).to.equal('Password');
    expect(inputElementConfirmPassord).to.equal('Confirm Password');
  });
});

I think i'm going to be in PDX tonight so maybe we can discuss in person.

andycwilliams commented 9 months ago

Were there any updates on this at last night's meeting?

timbot1789 commented 9 months ago

Were there any updates on this at last night's meeting?

@andycwilliams I walked JP through the testing framework we're using. He wants to add a few more tests to it, and add one more commit.

bingeboy commented 9 months ago

@timbot1789 I added another test for the ShowNewPod component.

bingeboy commented 9 months ago

Squashing and merging once all tests are 🟢