-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mihovil Ilakovac <[email protected]>
- Loading branch information
Showing
83 changed files
with
500 additions
and
11,192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,11 +8,10 @@ GOOGLE_CLIENT_ID='dummy-g-client-id.apps.googleusercontent.com' | |
GITHUB_CLIENT_ID='dummy-gh-client-id' | ||
GITHUB_CLIENT_SECRET='dummy-gh-client-secret' | ||
|
||
# Uncomment lines below and set them to real values if you want to use smtp email sender. | ||
# SMTP_HOST='smtp.dummy.com' | ||
# SMTP_USERNAME='[email protected]' | ||
# SMTP_PASSWORD='dummy_pass' | ||
# SMTP_PORT='587' | ||
SMTP_HOST='smtp.dummy.com' | ||
SMTP_USERNAME='[email protected]' | ||
SMTP_PASSWORD='dummy_pass' | ||
SMTP_PORT='587' | ||
|
||
# Uncomment lines below and set them to real values if you want to use Keycloak Auth. | ||
# KEYCLOAK_CLIENT_ID='dummy-id' | ||
|
@@ -24,3 +23,5 @@ DISCORD_CLIENT_SECRET='dummy-discord-client-secret' | |
DISCORD_CLIENT_ID='dummy-discord-client-id' | ||
|
||
MY_ENV_VAR=123 | ||
|
||
SKIP_EMAIL_VERIFICATION_IN_DEV=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
TEST_ENV_VAR="I am test" | ||
|
||
# Dummy values here will allow app to run, but you will need real values to get Google Auth to work. | ||
GOOGLE_CLIENT_SECRET='dummy-g-client-secret' | ||
GOOGLE_CLIENT_ID='dummy-g-client-id.apps.googleusercontent.com' | ||
|
||
# Dummy values here will allow app to run, but you will need real values to get GitHub Auth to work. | ||
GITHUB_CLIENT_ID='dummy-gh-client-id' | ||
GITHUB_CLIENT_SECRET='dummy-gh-client-secret' | ||
|
||
SMTP_HOST='smtp.dummy.com' | ||
SMTP_USERNAME='[email protected]' | ||
SMTP_PASSWORD='dummy_pass' | ||
SMTP_PORT='587' | ||
|
||
# Dummy values here will allow app to run, but you will need real values to get Discord Auth to work. | ||
DISCORD_CLIENT_SECRET='dummy-discord-client-secret' | ||
DISCORD_CLIENT_ID='dummy-discord-client-id' | ||
|
||
MY_ENV_VAR=123 | ||
|
||
SKIP_EMAIL_VERIFICATION_IN_DEV=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
const cp = require('child_process') | ||
const readline = require('linebyline') | ||
|
||
function spawn(name, cmd, args, done) { | ||
const spawnOptions = { | ||
detached: true, | ||
stdio: ['ignore', 'pipe', 'pipe'], | ||
} | ||
const proc = cp.spawn(cmd, args, spawnOptions) | ||
|
||
// We close stdin stream on the new process because otherwise the start-app | ||
// process hangs. | ||
// See https://github.com/wasp-lang/wasp/pull/1218#issuecomment-1599098272. | ||
// proc.stdin.destroy() | ||
|
||
readline(proc.stdout).on('line', (data) => { | ||
console.log(`\x1b[0m\x1b[33m[${name}][out]\x1b[0m ${data}`) | ||
}) | ||
readline(proc.stderr).on('line', (data) => { | ||
console.log(`\x1b[0m\x1b[33m[${name}][err]\x1b[0m ${data}`) | ||
}) | ||
proc.on('exit', done) | ||
} | ||
|
||
// Exit if either child fails | ||
const cb = (code) => { | ||
if (code !== 0) { | ||
process.exit(code) | ||
} | ||
} | ||
spawn('app', 'npm', ['run', 'headless:start-app'], cb) | ||
spawn('db', 'npm', ['run', 'headless:start-db'], cb) |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { test, expect } from '@playwright/test' | ||
import { generateRandomCredentials, performSignup } from './helpers' | ||
|
||
test.describe('CRUD test', () => { | ||
const { email, password } = generateRandomCredentials() | ||
|
||
test.describe.configure({ mode: 'serial' }) | ||
|
||
test.beforeAll(async ({ browser }) => { | ||
const page = await browser.newPage() | ||
|
||
await performSignup(page, { | ||
email, | ||
password, | ||
}) | ||
|
||
await expect(page.locator('body')).toContainText( | ||
`You've signed up successfully! Check your email for the confirmation link.` | ||
) | ||
}) | ||
|
||
test('CRUD with override works', async ({ page }) => { | ||
await page.goto('/login') | ||
|
||
await page.waitForSelector('text=Log in to your account') | ||
|
||
await page.locator("input[type='email']").fill(email) | ||
await page.locator("input[type='password']").fill(password) | ||
await page.getByRole('button', { name: 'Log in' }).click() | ||
|
||
await page.waitForSelector('text=User Auth Fields Demo') | ||
|
||
await page.goto('/crud') | ||
|
||
await page.waitForSelector('text=Tasks') | ||
|
||
await createTask(page, 'special filter 1') | ||
await createTask(page, 'special filter 2') | ||
await createTask(page, 'something else') | ||
|
||
await expect(page.locator('body')).toContainText('special filter 1') | ||
await expect(page.locator('body')).toContainText('special filter 2') | ||
await expect(page.locator("li[text='something else']")).not.toBeVisible() | ||
}) | ||
}) | ||
|
||
async function createTask(page: any, description: string) { | ||
await page.locator("input[type='text']").fill(description) | ||
await page.getByText('Create task').click() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.