Skip to content

Commit

Permalink
Merge pull request #22934 from storybookjs/revert-22835-chaks/add-e2e…
Browse files Browse the repository at this point in the history
…-test-to-addon-docs

Revert "Docs: E2E tests for Source block update fix"
  • Loading branch information
kasperpeulen authored and shilman committed Jun 8, 2023
1 parent 46a8d3f commit 9efe2be
Showing 1 changed file with 2 additions and 37 deletions.
39 changes: 2 additions & 37 deletions code/e2e-tests/addon-docs.spec.ts
Expand Up @@ -85,7 +85,7 @@ test.describe('addon-docs', () => {
test('should provide source snippet', async ({ page }) => {
// templateName is e.g. 'Vue-CLI (Default JS)'
test.skip(
/^(vue-cli|preact)/i.test(`${templateName}`),
/^(vue3|vue-cli|preact)/i.test(`${templateName}`),
`Skipping ${templateName}, which does not support dynamic source snippets`
);

Expand All @@ -111,6 +111,7 @@ test.describe('addon-docs', () => {

test('source snippet should not change in stories block', async ({ page }) => {
const skipped = [
'vue3',
'vue-cli',
'preact',
// SSv6 does not render stories in the correct order in our sandboxes
Expand Down Expand Up @@ -156,42 +157,6 @@ test.describe('addon-docs', () => {
await expect(storiesCode).toContainText('Basic');
});

test('source snippet should change back to previous value in stories block', async ({ page }) => {
test.skip(
/^(lit|vue-cli|preact|angular|internal\/ssv6|ca)/i.test(`${templateName}`),
`Skipping ${templateName}, which does not support dynamic source snippets`
);

const sbPage = new SbPage(page);
await sbPage.navigateToStory('addons/docs/docspage/basic', 'docs');
const root = sbPage.previewRoot();
const toggles = root.locator('.docblock-code-toggle');

const toggle = await toggles.nth(0);
await toggle.click({ force: true });

const codes = root.locator('pre.prismjs');

const code = await codes.nth(0);
const text = await code.innerText();

await expect(text).toContain('Basic');

const labelControl = root.locator('textarea[name=label]');
labelControl.fill('Changed');
labelControl.blur();

// Check the Primary one has changed
await expect(code).toContainText('Changed');

// Change the value back
labelControl.fill('Basic');
labelControl.blur();

// Check the Primary one has changed back
await expect(code).toContainText('Basic');
});

test('should not run autoplay stories without parameter', async ({ page }) => {
const sbPage = new SbPage(page);
await sbPage.navigateToStory('addons/docs/docspage/autoplay', 'docs');
Expand Down

0 comments on commit 9efe2be

Please sign in to comment.