|
1 | 1 | import type { ProjectFixtureDir } from '@tooling/system-tests'
|
2 |
| -import type { SinonStub } from 'sinon' |
3 | 2 | import { getPathForPlatform } from './support/getPathForPlatform'
|
4 | 3 |
|
5 | 4 | // @ts-ignore
|
@@ -1661,124 +1660,3 @@ describe('Migrate custom config files', () => {
|
1661 | 1660 | cy.contains(err)
|
1662 | 1661 | })
|
1663 | 1662 | })
|
1664 |
| - |
1665 |
| -describe('v13 migration welcome page with video', () => { |
1666 |
| - it('Welcome page should appear if video is not present (failure)', () => { |
1667 |
| - cy.withCtx((ctx, o) => { |
1668 |
| - const originalGetVideoEmbedHtml = ctx.migration.getVideoEmbedHtml |
1669 |
| - |
1670 |
| - o.sinon.stub(ctx.migration, 'getVideoEmbedHtml').callsFake(async () => { |
1671 |
| - const mockMigrationSourceGetVideoEmbedHtmlCTX = { |
1672 |
| - ctx: { |
1673 |
| - coreData: { |
1674 |
| - migration: { |
1675 |
| - videoEmbedHtml: undefined, |
1676 |
| - }, |
1677 |
| - }, |
1678 |
| - versions: { |
1679 |
| - versionData: () => { |
1680 |
| - return { |
1681 |
| - current: { |
1682 |
| - version: '13.0.0', |
1683 |
| - }, |
1684 |
| - } |
1685 |
| - }, |
1686 |
| - }, |
1687 |
| - util: { |
1688 |
| - fetch: () => { |
1689 |
| - throw new Error('kaboom') |
1690 |
| - }, |
1691 |
| - }, |
1692 |
| - }, |
1693 |
| - } |
1694 |
| - |
1695 |
| - return originalGetVideoEmbedHtml.apply(mockMigrationSourceGetVideoEmbedHtmlCTX) |
1696 |
| - }) |
1697 |
| - }) |
1698 |
| - |
1699 |
| - cy.scaffoldProject('migration-v12-to-v13') |
1700 |
| - cy.openProject('migration-v12-to-v13') |
1701 |
| - |
1702 |
| - cy.visitLaunchpad({ showWelcome: true }) |
1703 |
| - cy.contains(cy.i18n.majorVersionWelcome.title).should('be.visible') |
1704 |
| - cy.get('[data-cy="video-container"]').should('not.exist') |
1705 |
| - }) |
1706 |
| - |
1707 |
| - it('Welcome page should appear if video is not present (timeout)', () => { |
1708 |
| - cy.withCtx((ctx, o) => { |
1709 |
| - const originalGetVideoEmbedHtml = ctx.migration.getVideoEmbedHtml |
1710 |
| - |
1711 |
| - o.sinon.stub(ctx.migration, 'getVideoEmbedHtml').callsFake(async () => { |
1712 |
| - const mockMigrationSourceGetVideoEmbedHtmlCTX = { |
1713 |
| - ctx: { |
1714 |
| - coreData: { |
1715 |
| - migration: { |
1716 |
| - videoEmbedHtml: undefined, |
1717 |
| - }, |
1718 |
| - }, |
1719 |
| - versions: { |
1720 |
| - versionData: () => { |
1721 |
| - return { |
1722 |
| - current: { |
1723 |
| - version: '13.0.0', |
1724 |
| - }, |
1725 |
| - } |
1726 |
| - }, |
1727 |
| - }, |
1728 |
| - util: { |
1729 |
| - fetch: () => { |
1730 |
| - return new Promise((resolve, reject) => { |
1731 |
| - setTimeout(() => { |
1732 |
| - // the request should time out before this body is returned |
1733 |
| - resolve({ |
1734 |
| - json () { |
1735 |
| - return { |
1736 |
| - videoHtml: '<span>Stubbed Video Content</span>', |
1737 |
| - } |
1738 |
| - }, |
1739 |
| - }) |
1740 |
| - }, 4000) |
1741 |
| - }) |
1742 |
| - }, |
1743 |
| - }, |
1744 |
| - }, |
1745 |
| - } |
1746 |
| - |
1747 |
| - return originalGetVideoEmbedHtml.apply(mockMigrationSourceGetVideoEmbedHtmlCTX) |
1748 |
| - }) |
1749 |
| - }) |
1750 |
| - |
1751 |
| - cy.scaffoldProject('migration-v12-to-v13') |
1752 |
| - cy.openProject('migration-v12-to-v13') |
1753 |
| - |
1754 |
| - cy.visitLaunchpad({ showWelcome: true }) |
1755 |
| - cy.contains(cy.i18n.majorVersionWelcome.title, { |
1756 |
| - timeout: 8000, |
1757 |
| - }).should('be.visible') |
1758 |
| - |
1759 |
| - cy.get('[data-cy="video-container"]').should('not.exist') |
1760 |
| - }) |
1761 |
| - |
1762 |
| - it('Welcome page should appear if video is present', () => { |
1763 |
| - cy.scaffoldProject('migration-v12-to-v13') |
1764 |
| - cy.openProject('migration-v12-to-v13') |
1765 |
| - |
1766 |
| - cy.visitLaunchpad({ showWelcome: true }) |
1767 |
| - cy.contains(cy.i18n.majorVersionWelcome.title).should('be.visible') |
1768 |
| - cy.get('[data-cy="video-container"]').should('be.visible') |
1769 |
| - }) |
1770 |
| - |
1771 |
| - it('should only hit the video on link once & cache it', () => { |
1772 |
| - cy.scaffoldProject('migration-v12-to-v13') |
1773 |
| - cy.openProject('migration-v12-to-v13') |
1774 |
| - |
1775 |
| - cy.visitLaunchpad({ showWelcome: true }) |
1776 |
| - cy.contains(cy.i18n.majorVersionWelcome.title).should('be.visible') |
1777 |
| - |
1778 |
| - cy.visitLaunchpad({ showWelcome: true }) |
1779 |
| - cy.contains(cy.i18n.majorVersionWelcome.title).should('be.visible') |
1780 |
| - cy.withCtx((ctx, o) => { |
1781 |
| - expect((ctx.util.fetch as SinonStub).args.filter((a) => String(a[0]).includes('v13-video-embed')).length).to.eq(1) |
1782 |
| - }) |
1783 |
| - }) |
1784 |
| -}) |
0 commit comments