Skip to content
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

Docs: Revert "Docs: E2E tests for Source block update fix" #22835 #22934

Merged
merged 1 commit into from
Jun 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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