Skip to content

Video 9513 update disabled video UI #708

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

Closed
wants to merge 18 commits into from
Closed
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
16 changes: 16 additions & 0 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module.exports = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
{
name: '@storybook/addon-essentials',
options: { backgrounds: false, docs: false },
},
'@storybook/preset-create-react-app',
],
framework: '@storybook/react',
webpackFinal: config => {
config.resolve.alias['twilio-video'] = require.resolve('../src/stories/mocks/twilio-video.js');
return config;
},
};
15 changes: 15 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { decorator as TwilioVideoMockDecorator } from '../src/stories/mocks/twilio-video.js';

// Add the decorator to all stories
export const decorators = [TwilioVideoMockDecorator];

export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
layout: 'fullscreen',
};
2 changes: 1 addition & 1 deletion app.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
runtime: nodejs12
runtime: nodejs16

entrypoint: npm run server

Expand Down
9 changes: 8 additions & 1 deletion cypress/integration/twilio-video.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,14 @@ const getRoomName = () =>
context('A video app user', () => {
describe('before entering a room', () => {
it('should see their audio level indicator moving in the media device panel', () => {
cy.visit('/');
// These tests were written before Grid View was implemented. This app now activates
// Grid View by default, so here we activate Presentation View before visiting the app so
// that the tests can pass.
cy.visit('/', {
onBeforeLoad: window => {
window.localStorage.setItem('grid-view-active-key', false);
},
});

cy.get('#input-user-name').type('testuser');
cy.get('#input-room-name').type(getRoomName());
Expand Down
8 changes: 8 additions & 0 deletions cypress/plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ module.exports = (on, config) => {
args,
});
const page = (participants[name] = await browser.newPage()); // keep track of this participant for future use

// These tests were written before Grid View was implemented. This app now activates
// Grid View by default, so here we activate Presentation View before visiting the app so
// that the tests can pass.
await page.evaluateOnNewDocument(() => {
localStorage.clear();
localStorage.setItem('grid-view-active-key', false);
});
await page.goto(config.baseUrl);
await page.type('#input-user-name', name);
await page.type('#input-room-name', roomName);
Expand Down
9 changes: 8 additions & 1 deletion cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import detectSound from './detectSound';

Cypress.Commands.add('joinRoom', (username, roomname) => {
cy.visit('/');
// These tests were written before Grid View was implemented. This app now activates
// Grid View by default, so here we activate Presentation View before visiting the app so
// that the tests can pass.
cy.visit('/', {
onBeforeLoad: window => {
window.localStorage.setItem('grid-view-active-key', false);
},
});
cy.get('#input-user-name').type(username);
cy.get('#input-room-name').type(roomname);
cy.get('[type="submit"]').click();
Expand Down
Loading