-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from Bricks666/develop
v2.1.0
- Loading branch information
Showing
161 changed files
with
8,727 additions
and
9,218 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
VITE_API_HOST='' | ||
BASE_CLIENT_URL=http://localhost:3000 | ||
API_HOST=http://localhost:5000/api |
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,2 @@ | ||
BASE_CLIENT_URL=http://localhost:3000 | ||
API_HOST=http://localhost:5000/api |
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,74 @@ | ||
import { expect } from '@playwright/test'; | ||
import { faker } from '@faker-js/faker'; | ||
|
||
import { User, test } from './fixtures'; | ||
import { expectAlert } from './utils'; | ||
|
||
test.describe('account activate page(online)', () => { | ||
let user: User; | ||
let activateLink: string; | ||
|
||
test.beforeEach( | ||
async ({ | ||
page, | ||
user: getUser, | ||
activateAccountLink: getActivateAccountLink, | ||
}) => { | ||
user = await getUser({ | ||
email: faker.internet.email(), | ||
activated: false, | ||
}); | ||
|
||
activateLink = await getActivateAccountLink(user); | ||
|
||
await page.goto(activateLink); | ||
} | ||
); | ||
|
||
test('has correct view', async ({ page }) => { | ||
await expect(page).toHaveScreenshot(); | ||
}); | ||
|
||
test('has right title', async ({ page }) => { | ||
await expect(page).toHaveTitle(/Account activation/); | ||
}); | ||
|
||
test('can navigate to login page', async ({ page }) => { | ||
const link = page.getByRole('link', { name: 'go to login page' }); | ||
|
||
await link.click(); | ||
|
||
await expect(page).toHaveURL('/login'); | ||
}); | ||
|
||
test('cannot open if authorized', async ({ page, auth }) => { | ||
const u = await auth({ | ||
email: faker.internet.email(), | ||
}); | ||
|
||
await page.reload(); | ||
|
||
await expect(page).toHaveURL('/rooms'); | ||
}); | ||
|
||
test('show error if account has been already activated', async ({ | ||
page, | ||
user: getUser, | ||
activateAccountLink: getActivateAccountLink, | ||
}) => { | ||
user = await getUser({ | ||
email: faker.internet.email(), | ||
activated: true, | ||
}); | ||
|
||
activateLink = await getActivateAccountLink(user); | ||
|
||
await page.goto(activateLink); | ||
|
||
await expectAlert({ | ||
type: 'error', | ||
parent: page, | ||
message: 'The account has already been activated', | ||
}); | ||
}); | ||
}); |
Binary file added
BIN
+16 KB
...ts-snapshots/account-activate-page-online-has-correct-view-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+42.9 KB
....ts-snapshots/account-activate-page-online-has-correct-view-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,122 @@ | ||
import { faker } from '@faker-js/faker'; | ||
import { expect } from '@playwright/test'; | ||
import { Room, User, test } from './fixtures'; | ||
|
||
test.describe('activities page(online)', () => { | ||
const iterator = new Array(100).fill(true); | ||
|
||
let user: User; | ||
let room: Room; | ||
|
||
test.beforeEach(async ({ auth, room: getRoom, activity, page }) => { | ||
const data = await auth({ | ||
email: faker.internet.email(), | ||
}); | ||
|
||
user = data.user; | ||
|
||
room = await getRoom({ | ||
ownerId: user.id, | ||
}); | ||
|
||
await Promise.all( | ||
iterator.map((_, index) => { | ||
const moreThanHalf = index >= 50; | ||
const action = moreThanHalf ? 'update' : 'create'; | ||
|
||
return activity({ room, activist: user, action }); | ||
}) | ||
); | ||
|
||
await page.goto(`/rooms/${room.id}/activities`); | ||
}); | ||
|
||
test('has correct view', async ({ page }) => { | ||
await expect(page).toHaveScreenshot(); | ||
}); | ||
|
||
test('has right title', async ({ page }) => { | ||
await expect(page).toHaveTitle(/Activities/); | ||
}); | ||
|
||
test('has been navigated to first page by default', async ({ page }) => { | ||
await expect( | ||
page.getByRole('link', { name: 'page 1', exact: true }) | ||
).toBeVisible(); | ||
}); | ||
|
||
test('can navigate to another page', async ({ page }) => { | ||
const link = page.getByRole('link', { name: 'Go to page 2', exact: true }); | ||
await link.click(); | ||
|
||
await expect(page).toHaveURL(/p=2/); | ||
await expect( | ||
page.getByRole('link', { name: 'page 2', exact: true }) | ||
).toBeVisible(); | ||
}); | ||
|
||
test('can filter activities', async ({ page }) => { | ||
const filterButton = page.getByRole('button', { | ||
name: 'Activities filters', | ||
}); | ||
await filterButton.click(); | ||
|
||
const form = page.getByRole('form', { | ||
name: 'Activities filters', | ||
exact: true, | ||
}); | ||
await expect(form).toBeVisible(); | ||
const action = form.getByLabel('Action'); | ||
await action.fill('create'); | ||
await page.getByRole('option').click(); | ||
const apply = form.getByRole('button', { name: 'Apply', exact: true }); | ||
await apply.click(); | ||
|
||
await expect(page).toHaveURL(/action=1/); | ||
await expect( | ||
page.getByRole('link', { name: 'Go to page 2', exact: true }) | ||
).toBeHidden(); | ||
await expect(page.getByText('updated')).toBeHidden(); | ||
|
||
await filterButton.click(); | ||
const sphere = form.getByLabel('Sphere'); | ||
await sphere.fill('tag'); | ||
await page.getByRole('option').click(); | ||
await apply.click(); | ||
370; | ||
|
||
await expect(page).toHaveURL(/action=1&sphere=2/); | ||
await expect(page.getByRole('list')).toBeHidden(); | ||
|
||
await filterButton.click(); | ||
await form.getByRole('button', { name: 'Reset' }).click(); | ||
|
||
await expect( | ||
page.getByRole('link', { name: 'Go to page 2', exact: true }) | ||
).toBeVisible(); | ||
await expect( | ||
page.getByRole('list').filter({ hasText: 'User' }) | ||
).toBeVisible(); | ||
}); | ||
|
||
test('add activities if there has been added new one', async ({ | ||
page, | ||
activity, | ||
}) => { | ||
const data = { | ||
room, | ||
activist: user, | ||
action: 'remove', | ||
sphere: 'tag', | ||
createdAt: new Date(), | ||
}; | ||
|
||
const listitem = page.getByRole('listitem').filter({ hasText: 'removed' }); | ||
|
||
await expect(listitem).toBeHidden(); | ||
|
||
await activity(data); | ||
|
||
await expect(listitem).toBeVisible(); | ||
}); | ||
}); |
Binary file added
BIN
+74.3 KB
....spec.ts-snapshots/activities-page-online-has-correct-view-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+125 KB
...s.spec.ts-snapshots/activities-page-online-has-correct-view-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,16 @@ | ||
import { mergeTests } from '@playwright/test'; | ||
|
||
import { test as testingApiTest } from './testing-api'; | ||
|
||
export const test = mergeTests(testingApiTest); | ||
|
||
export type { | ||
User, | ||
Login, | ||
Room, | ||
Tokens, | ||
Tag, | ||
Task, | ||
Invitation, | ||
Member, | ||
} from './testing-api'; |
Oops, something went wrong.