Skip to content

Commit

Permalink
Merge branch 'develop' into chore/user-info
Browse files Browse the repository at this point in the history
  • Loading branch information
dougfabris committed Jul 27, 2022
2 parents eaa1e1e + 3ca01a8 commit 545ae1e
Show file tree
Hide file tree
Showing 18 changed files with 267 additions and 475 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ Template.messageBoxAudioMessage.events({
const { rid, tmid } = this;
const blob = await cancelRecording(instance, rid, tmid);

await fileUpload([{ file: blob, type: 'video', name: `${t('Audio record')}.mp3` }], { input: blob }, { rid, tmid });
const fileName = `${t('Audio record')}.mp3`;
const file = new File([blob], fileName, { type: 'audio/mpeg' });

await fileUpload([{ file, type: 'audio/mpeg', name: fileName }], { input: blob }, { rid, tmid });
},
});
5 changes: 4 additions & 1 deletion apps/meteor/app/ui/client/lib/recorderjs/audioEncoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ class AudioEncoder extends Emitter {
handleWorkerMessage = (event) => {
switch (event.data.command) {
case 'end': {
const blob = new Blob(event.data.buffer, { type: 'audio/mpeg' });
// prepend mp3 magic number to the buffer
const magicNoPrefix = new Int8Array([73, 68, 51, 3, 0, 0, 0, 0, 0, 0]);
const bufferWithMagicNo = [magicNoPrefix, ...event.data.buffer];
const blob = new Blob(bufferWithMagicNo, { type: 'audio/mpeg' });
this.emit('encoded', blob);
this.worker.terminate();
break;
Expand Down
4 changes: 2 additions & 2 deletions apps/meteor/client/views/admin/apps/AppSecurity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ const AppSecurity: FC<AppSecurityProps> = ({ privacyPolicySummary, appPermission
</Box>
<Box display='flex' flexDirection='column'>
{tosLink && (
<Box is='a' href={tosLink}>
<Box is='a' href={tosLink} target='_blank'>
{t('Terms_of_use')}
</Box>
)}
{privacyLink && (
<Box is='a' href={privacyLink}>
<Box is='a' href={privacyLink} target='_blank'>
{t('Privacy_policy')}
</Box>
)}
Expand Down
8 changes: 3 additions & 5 deletions apps/meteor/tests/e2e/01-forgot-password.spec.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import { Page, test, expect } from '@playwright/test';
import { test, expect } from '@playwright/test';

import { Auth } from './page-objects';

test.describe('Forgot Password', () => {
let page: Page;
let pageAuth: Auth;

test.beforeAll(async ({ browser }) => {
page = await browser.newPage();
test.beforeEach(async ({ page }) => {
pageAuth = new Auth(page);
});

test.beforeAll(async () => {
test.beforeEach(async ({ page }) => {
await page.goto('/');
await pageAuth.btnForgotPassword.click();
});
Expand Down
8 changes: 3 additions & 5 deletions apps/meteor/tests/e2e/02-register.spec.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import { Page, test, expect } from '@playwright/test';
import { test, expect } from '@playwright/test';
import { faker } from '@faker-js/faker';

import { Auth } from './page-objects';

test.describe('Register', () => {
let page: Page;
let pageAuth: Auth;

test.beforeAll(async ({ browser }) => {
page = await browser.newPage();
test.beforeEach(async ({ page }) => {
pageAuth = new Auth(page);
});

test.beforeEach(async () => {
test.beforeEach(async ({ page }) => {
await page.goto('/');
await pageAuth.btnRegister.click();
});
Expand Down
9 changes: 3 additions & 6 deletions apps/meteor/tests/e2e/03-login.spec.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
import { Page, test, expect } from '@playwright/test';
import { test, expect } from '@playwright/test';
import { faker } from '@faker-js/faker';

import { Auth } from './page-objects';

test.describe('Login', () => {
let page: Page;
let pageAuth: Auth;

test.beforeAll(async ({ browser }) => {
page = await browser.newPage();
test.beforeEach(async ({ page }) => {
pageAuth = new Auth(page);
await page.goto('/');
});

test('expect to show a toast if the provided password is incorrect', async () => {
await page.goto('/');

await pageAuth.inputEmailOrUsername.type(faker.internet.email());
await pageAuth.inputPassword.type('any_password');
await pageAuth.btnSubmit.click();
Expand Down
12 changes: 5 additions & 7 deletions apps/meteor/tests/e2e/05-channel-creation.spec.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
import { Page, test, expect } from '@playwright/test';
import { test, expect } from '@playwright/test';
import { faker } from '@faker-js/faker';

import { HomeChannel, Auth } from './page-objects';

test.describe('Channel Creation', () => {
let page: Page;
let pageAuth: Auth;
let pageHomeChannel: HomeChannel;

test.beforeAll(async ({ browser }) => {
page = await browser.newPage();
test.beforeEach(async ({ page }) => {
pageAuth = new Auth(page);
pageHomeChannel = new HomeChannel(page);
});

test.beforeAll(async () => {
test.beforeEach(async () => {
await pageAuth.doLogin();
});

test('expect create public channel', async () => {
test('expect create public channel', async ({ page }) => {
const name = faker.animal.type() + Date.now();

await pageHomeChannel.sidenav.btnCreate.click();
Expand All @@ -30,7 +28,7 @@ test.describe('Channel Creation', () => {
await expect(page).toHaveURL(`/channel/${name}`);
});

test('expect create private channel', async () => {
test('expect create private channel', async ({ page }) => {
const name = faker.animal.type() + Date.now();

await pageHomeChannel.sidenav.btnCreate.click();
Expand Down
Loading

0 comments on commit 545ae1e

Please sign in to comment.