Skip to content

Commit

Permalink
Merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhabib committed May 24, 2024
1 parent c0e1e2c commit 21e9c78
Show file tree
Hide file tree
Showing 24 changed files with 537 additions and 238 deletions.
5 changes: 5 additions & 0 deletions .changeset/swift-fans-decide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'playroom': patch
---

Remove `data-testid` attributes from UI elements
2 changes: 1 addition & 1 deletion cypress/e2e/editor.cy.js → cypress/e2e/editor.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('Editor', () => {
});

it('autocompletes', () => {
typeCode('<F{enter} c{enter}={downarrow}{enter} />', { delay: 100 });
typeCode('<F{enter} c{enter}={downarrow}{enter} />', 100);
assertFirstFrameContains('Foo');
assertCodePaneContains('<Foo color="blue" />');
});
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/keymaps.cy.js → cypress/e2e/keymaps.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ describe('Keymaps', () => {
});

it('should jump to line and column number correctly', () => {
jumpToLine('6:10');
jumpToLine(6, 10);
typeCode('a');

assertCodePaneContains(dedent`
Expand Down
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions cypress/e2e/snippets.cy.js → cypress/e2e/snippets.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
filterSnippets,
toggleSnippets,
assertSnippetCount,
assertSnippetsListIsVisible,
assertSnippetsSearchFieldIsVisible,
mouseOverSnippet,
loadPlayroom,
} from '../support/utils';
Expand All @@ -23,7 +23,7 @@ describe('Snippets', () => {
it('driven with mouse', () => {
// Open and format for insertion point
toggleSnippets();
assertSnippetsListIsVisible();
assertSnippetsSearchFieldIsVisible();
assertCodePaneLineCount(8);

// Browse snippetlist
Expand Down Expand Up @@ -69,12 +69,12 @@ describe('Snippets', () => {
it('driven with keyboard', () => {
// Open and format for insertion point
typeCode(`${isMac() ? '{cmd}' : '{ctrl}'}k`);
assertSnippetsListIsVisible();
assertSnippetsSearchFieldIsVisible();
assertCodePaneLineCount(8);
filterSnippets('{esc}');
assertCodePaneLineCount(1, { wait: 500 });
assertCodePaneLineCount(1, true);
typeCode(`${isMac() ? '{cmd}' : '{ctrl}'}k`);
assertSnippetsListIsVisible();
assertSnippetsSearchFieldIsVisible();
assertCodePaneLineCount(8);

// Browse snippetlist
Expand All @@ -89,7 +89,7 @@ describe('Snippets', () => {
// Close without persisting
filterSnippets('{esc}');
assertCodePaneContains('<div>Initial <span>code</span></div>');
assertCodePaneLineCount(1, { wait: 500 });
assertCodePaneLineCount(1, true);

// Re-open and persist
typeCode(`${isMac() ? '{cmd}' : '{ctrl}'}k`);
Expand Down
9 changes: 5 additions & 4 deletions cypress/e2e/toolbar.cy.js → cypress/e2e/toolbar.cy.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
assertFramesMatch,
selectWidthPreferenceByIndex,
assertPreviewContains,
typeCode,
gotoPreview,
loadPlayroom,
selectWidthPreference,
} from '../support/utils';

describe('Toolbar', () => {
Expand All @@ -13,11 +13,11 @@ describe('Toolbar', () => {
});

it('filter widths', () => {
const frames = ['320px', '375px', '768px', '1024px'];
const frames = [320, 375, 768, 1024];
const widthIndexToSelect = 1;

assertFramesMatch(frames);
selectWidthPreferenceByIndex(widthIndexToSelect);
selectWidthPreference(frames[widthIndexToSelect]);
assertFramesMatch([frames[widthIndexToSelect]]);
});

Expand Down Expand Up @@ -45,8 +45,9 @@ describe('Toolbar', () => {
}
});
})
.get('[data-testid="copyToClipboard"]')
.findByRole('button', { name: /Copy Playroom link/i })
.click();

cy.then(() => expect(copySpy).to.have.been.called);
});
});
10 changes: 5 additions & 5 deletions cypress/e2e/urlHandling.cy.js → cypress/e2e/urlHandling.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('URL handling', () => {
'http://localhost:9000/#?code=N4Ig7glgJgLgFgZxALgNoGYDsBWANJgNgA4BdAXyA'
);

assertFramesMatch(['375px', '768px']);
assertFramesMatch([375, 768]);
});
});

Expand All @@ -40,10 +40,10 @@ describe('URL handling', () => {
);

assertFramesMatch([
'themeOne – 375px',
'themeTwo – 375px',
'themeOne – 768px',
'themeTwo – 768px',
['themeOne', 375],
['themeTwo', 375],
['themeOne', 768],
['themeTwo', 768],
]);
});
});
Expand Down
2 changes: 2 additions & 0 deletions cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '@testing-library/cypress/add-commands';

Cypress.Commands.add(
'getFromPreviewFrame',
{ prevSubject: 'element' },
Expand Down
Loading

0 comments on commit 21e9c78

Please sign in to comment.