Skip to content

Instantly share code, notes, and snippets.

View mtreacy002's full-sized avatar
🎯
Focusing

Maya Treacy mtreacy002

🎯
Focusing
  • Victoria, Australia
View GitHub Profile
@mtreacy002
mtreacy002 / login.test.js
Created July 17, 2021 12:33
login test failed with afterEach(cleanup)
FAIL src/tests/Login.test.jsx (5.858s)
● Console
console.error node_modules/@testing-library/react/dist/act-compat.js:52
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
in Login (at Login.test.jsx:31)
in Router (created by BrowserRouter)
in BrowserRouter (at Login.test.jsx:31)
console.error node_modules/@testing-library/react/dist/act-compat.js:52
Warning: You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one.
@mtreacy002
mtreacy002 / failed_test_signup.jsx
Created July 16, 2021 04:10
Failed tests new design SignUp pr 262
FAIL src/tests/Register.test.js
● allows the user to register successfully
Unable to find an element with the placeholder text of: Full Name
<body>
<div>
<div
class="preloader"
/>
@mtreacy002
mtreacy002 / env.py
Created March 28, 2021 23:20
env.py for flask migraton with BIT multiple schemas scenario
from __future__ import with_statement
import logging
from logging.config import fileConfig
from sqlalchemy import engine_from_config
from sqlalchemy import pool
from alembic import context
@mtreacy002
mtreacy002 / scrip.py.mako
Created March 28, 2021 23:18
scrip.py.mako for flask-migrate with BIT multiple schema scenario
"""${message}
Revision ID: ${up_revision}
Revises: ${down_revision | comma,n}
Create Date: ${create_date}
"""
from alembic import op
import sqlalchemy as sa
${imports if imports else ""}
@mtreacy002
mtreacy002 / alembic.ini
Created March 28, 2021 23:16
Alembic file for flask-migration with BIT multiple schema scenario
# A generic, single database configuration.
[alembic]
# template used to generate migration files
# file_template = %%(rev)s_%%(slug)s
# set to 'true' to run the environment during
# the 'revision' command, regardless of autogenerate
# revision_environment = false
@mtreacy002
mtreacy002 / test_log.txt
Created March 10, 2021 01:01
Error running npm test
PASS src/tests/PersonalDetails.test.js (7.322s)
● Console
console.error node_modules/react-dom/cjs/react-dom.development.js:88
Warning: An update to PersonalDetails inside a test was not wrapped in act(...).
When testing, code that causes React state updates should be wrapped into act(...):
act(() => {
@mtreacy002
mtreacy002 / docker_pr_208.txt
Last active March 10, 2021 00:15
running docker-compose up output for BIT backend pr 208
# output on `docker-compose up`
Creating network "bridge-in-tech-backend_default" with the default driver
Pulling postgres (postgres:)...
latest: Pulling from library/postgres
// continute the rests
Status: Downloaded newer image for postgres:latest
// then it continues building ms first, which is not ideal, cause will mess db schemas
Building ms
Step 1/6 : FROM python:3.7
@mtreacy002
mtreacy002 / npm_vulnerability.txt
Last active March 9, 2021 10:59
Vulnerability reports on new npm install
=== npm audit security report ===
# Run npm install react-scripts@4.0.3 to resolve 2 vulnerabilities
SEMVER WARNING: Recommended action is a potentially breaking change
High Prototype Pollution
Package object-path
Dependency of react-scripts
@mtreacy002
mtreacy002 / error.txt
Created March 3, 2021 10:44
terminal error pr-189
127.0.0.1 - - [03/Mar/2021 21:18:35] "PUT /organization HTTP/1.1" 500 -
INFO:werkzeug:127.0.0.1 - - [03/Mar/2021 21:18:35] "PUT /organization HTTP/1.1" 500 -
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
context)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line 507, in do_execute
cursor.execute(statement, parameters)
psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "uq_organizations_name"
DETAIL: Key (name)=(MTreacy.Co) already exists.
@mtreacy002
mtreacy002 / bit_mentorship_relation_user_request.py
Last active February 19, 2021 04:16
BIT Mentorship relation flow - user send request to work as mentor/mentee
# for mentorship_relations dummy data
# 2nd scenario.
# user send request to work as program mentor/mentee
# prepare empty tasks_list for mentorship_relation1
tasks_list_1 = TasksListModel()
db.session.add(tasks_list_1)
db.session.commit()