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

Add frontend tests #69

Closed
wants to merge 20 commits into from
Closed

Add frontend tests #69

wants to merge 20 commits into from

Conversation

Firebird1029
Copy link
Member

Add frontend tests

Problem

Currently, the Electron app frontend lacks frontend tests.

Solution

This PR adds some frontend tests to ensure the Electron app works correctly.

Result

To run the tests:

cd frontend
npx playwright test

Firebird1029 and others added 20 commits July 8, 2024 16:17
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Isaac Milarsky <isaac.milarsky@hhs.cms.gov>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Isaac Milarsky <isaac.milarsky@hhs.cms.gov>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Isaac Milarsky <isaac.milarsky@hhs.cms.gov>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Isaac Milarsky <imilarsky@gmail.com>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Isaac Milarsky <isaac.milarsky@hhs.cms.gov>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Signed-off-by: Brandon Yee <6111102+Firebird1029@users.noreply.github.com>
Test dedupe_data function with specific CSV data to verify deduplication.
"""
# Prepare test data
test_data_csv = """id,truth_value,family_name,given_name,gender,birth_date,phone,street_address,city,state,postal_code,SSN
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0301: Line too long (126/100) (line-too-long)

Test dedupe_data function for deduplication accuracy using a dataset with known duplicates.
"""
# Prepare test data
test_data_csv = """id,truth_value,family_name,given_name,gender,birth_date,phone,street_address,city,state,postal_code,SSN
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
C0301: Line too long (126/100) (line-too-long)

"""
return CliRunner()

def test_dedupe_data_with_csv_output(cli_runner):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'cli_runner' from outer scope (line 36) (redefined-outer-name)

# Clean up: delete output file
os.remove(output_path)

def test_dedupe_data_with_specific_csv(cli_runner):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'cli_runner' from outer scope (line 36) (redefined-outer-name)

os.remove('specific.csv')


def test_dedupe_data_with_json_output(cli_runner):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'cli_runner' from outer scope (line 36) (redefined-outer-name)

# Clean up: delete output file
os.remove(output_path)

def test_dedupe_data_with_invalid_format(cli_runner):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'cli_runner' from outer scope (line 36) (redefined-outer-name)

os.remove(output_path)
os.remove(bad_data_path)

def test_dedupe_accuracy(cli_runner):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'cli_runner' from outer scope (line 36) (redefined-outer-name)

5000,
2500
],indirect=True)
def test_dedupe_data_with_large_dataset(generate_mock_data_fixture, cli_runner):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'generate_mock_data_fixture' from outer scope (line 18) (redefined-outer-name)

5000,
2500
],indirect=True)
def test_dedupe_data_with_large_dataset(generate_mock_data_fixture, cli_runner):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[pylint] reported by reviewdog 🐶
W0621: Redefining name 'cli_runner' from outer scope (line 36) (redefined-outer-name)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants