Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added starbucks test coverage #37

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/components/starbucks-input/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React from 'react';
import PropTypes from 'prop-types';


const StarbucksInput = ({ name, value, onChange, error }) => {
return (
<>
<label htmlFor={name}>{name}</label>
<input
id={name}
name={name}
value={value}
onChange={(e) => onChange(e.target.value)}
/>
{error && <span>{error}</span>}
</>
)
};

StarbucksInput.propTypes = {
name: PropTypes.string,
value: PropTypes.string,
onChange: PropTypes.func,
error: PropTypes.string,
};

StarbucksInput.defaultProps = {
value: '',
onChange: () => { },
error: '',
name: ""
};

export default StarbucksInput;
2 changes: 1 addition & 1 deletion src/components/starbucks-input/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import StarbucksInput from './index.js';
import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event'

describe.skip('starbucks input tests', () => {
describe('starbucks input tests', () => {
test('it renders input component', async () => {
// Assemble
const elName = 'nickname';
Expand Down