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

Fix: ci scripts not running on dev environment #17

Merged
merged 4 commits into from
Dec 7, 2022
Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/ci-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: ci-dev.yml
on:
push:
branches:
- main
- dev
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -83,4 +83,4 @@ jobs:
# with:
# apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# command: pages publish ".svelte-kit/cloudflare" --project-name=cro-website
# command: pages publish ".svelte-kit/cloudflare" --project-name=cro-website
4 changes: 2 additions & 2 deletions src/routes/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
const isHomePage = /^\/home\/(.*)/.test(page.path)
const isProfilePage = /^\/profile\/(.*)/.test(page.path)
const isPremiumPage = /^\/premium\/(.*)/.test(page.path)
const isChannelDetailsPage = /^\/channel\/(.*)/.test(page.path)
const isChannelPage = /^\/channel\/(.*)/.test(page.path)
const isMaintenanceModeEnabled = true
if (
!session.user &&
(isAdminPage || isHomePage || isProfilePage || isPremiumPage || isChannelDetailsPage)
(isAdminPage || isHomePage || isProfilePage || isPremiumPage || isChannelPage)
) {
return {
status: 302,
Expand Down
1 change: 1 addition & 0 deletions src/routes/admin/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Welcome to admin page</h1>
Empty file.
1 change: 1 addition & 0 deletions src/routes/channel/[channelId]/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Welcome to channel page</h1>
1 change: 1 addition & 0 deletions src/routes/contact/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Welcome to contact page</h1>
1 change: 1 addition & 0 deletions src/routes/home/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Welcome to home page</h1>
1 change: 1 addition & 0 deletions src/routes/legal/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Welcome to legal page</h1>
1 change: 1 addition & 0 deletions src/routes/login/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Welcome to login page</h1>
1 change: 1 addition & 0 deletions src/routes/maintenance/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Welcome to maintenance page</h1>
1 change: 1 addition & 0 deletions src/routes/not-found/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Welcome to not-found page</h1>
1 change: 1 addition & 0 deletions src/routes/premium/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Welcome to premium page</h1>
1 change: 1 addition & 0 deletions src/routes/profile/[customUsername]/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Welcome to profile page</h1>
1 change: 1 addition & 0 deletions src/routes/settings/+page.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<h1>Welcome to settings page</h1>
6 changes: 6 additions & 0 deletions tests/admin.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { expect, test } from '@playwright/test'

test('admin page has expected h1', async ({ page }) => {
await page.goto('/admin')
expect(await page.textContent('h1')).toBe('Welcome to admin page')
})
6 changes: 6 additions & 0 deletions tests/channel.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { expect, test } from '@playwright/test'

test('channel page has expected h1', async ({ page }) => {
await page.goto('/channel/123')
expect(await page.textContent('h1')).toBe('Welcome to channel page')
})
6 changes: 6 additions & 0 deletions tests/contact.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { expect, test } from '@playwright/test'

test('contact page has expected h1', async ({ page }) => {
await page.goto('/contact')
expect(await page.textContent('h1')).toBe('Welcome to contact page')
})
6 changes: 6 additions & 0 deletions tests/home.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { expect, test } from '@playwright/test'

test('home page has expected h1', async ({ page }) => {
await page.goto('/home')
expect(await page.textContent('h1')).toBe('Welcome to home page')
})
6 changes: 6 additions & 0 deletions tests/legal.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { expect, test } from '@playwright/test'

test('legal page has expected h1', async ({ page }) => {
await page.goto('/legal')
expect(await page.textContent('h1')).toBe('Welcome to legal page')
})
6 changes: 6 additions & 0 deletions tests/login.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { expect, test } from '@playwright/test'

test('login page has expected h1', async ({ page }) => {
await page.goto('/login')
expect(await page.textContent('h1')).toBe('Welcome to login page')
})
6 changes: 6 additions & 0 deletions tests/maintenance.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { expect, test } from '@playwright/test'

test('maintenance page has expected h1', async ({ page }) => {
await page.goto('/maintenance')
expect(await page.textContent('h1')).toBe('Welcome to maintenance page')
})
6 changes: 6 additions & 0 deletions tests/not-found.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { expect, test } from '@playwright/test'

test('not found page has expected h1', async ({ page }) => {
await page.goto('/not-found')
expect(await page.textContent('h1')).toBe('Welcome to not-found page')
})
6 changes: 6 additions & 0 deletions tests/premium.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { expect, test } from '@playwright/test'

test('premium page has expected h1', async ({ page }) => {
await page.goto('/premium')
expect(await page.textContent('h1')).toBe('Welcome to premium page')
})
6 changes: 6 additions & 0 deletions tests/profile.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { expect, test } from '@playwright/test'

test('profile page has expected h1', async ({ page }) => {
await page.goto('/profile/123')
expect(await page.textContent('h1')).toBe('Welcome to profile page')
})
6 changes: 6 additions & 0 deletions tests/settings.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { expect, test } from '@playwright/test'

test('settings page has expected h1', async ({ page }) => {
await page.goto('/settings')
expect(await page.textContent('h1')).toBe('Welcome to settings page')
})
6 changes: 0 additions & 6 deletions tests/test.ts

This file was deleted.