Skip to content

Commit 79eb3f3

Browse files
authored
Merge pull request codesandbox#2135 from lbogdan/change/integration
Update integration tests to use sandboxes repository
2 parents 2e3e171 + d6661df commit 79eb3f3

7 files changed

+12
-7
lines changed

packages/app/integration-tests/tests/__image_snapshots__/github-CompuIves-codesandbox-presentation-snap.png renamed to packages/app/integration-tests/tests/__image_snapshots__/CompuIves-codesandbox-presentation-snap.png

File renamed without changes.

packages/app/integration-tests/tests/__image_snapshots__/github-algolia-doc-onboarding-tree-master-demos-angular-media-snap.png renamed to packages/app/integration-tests/tests/__image_snapshots__/algolia-doc-onboarding-demos-angular-media-snap.png

File renamed without changes.

packages/app/integration-tests/tests/__image_snapshots__/github-cssinjs-egghead-tree-master-from-sass-to-cssinjs-templates-and-variables-snap.png renamed to packages/app/integration-tests/tests/__image_snapshots__/cssinjs-egghead-templates-and-variables-snap.png

File renamed without changes.

packages/app/integration-tests/tests/__image_snapshots__/github-faceyspacey-redux-first-router-codesandbox-tree-master-snap.png renamed to packages/app/integration-tests/tests/__image_snapshots__/faceyspacey-redux-first-router-codesandbox-snap.png

File renamed without changes.

packages/app/integration-tests/tests/__image_snapshots__/github-reduxjs-redux-tree-master-examples-real-world-snap.png renamed to packages/app/integration-tests/tests/__image_snapshots__/reduxjs-redux-examples-real-world-snap.png

File renamed without changes.

packages/app/integration-tests/tests/__image_snapshots__/github-reduxjs-redux-tree-master-examples-todomvc-snap.png renamed to packages/app/integration-tests/tests/__image_snapshots__/reduxjs-redux-examples-todomvc-snap.png

File renamed without changes.

packages/app/integration-tests/tests/sandboxes.test.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,28 @@ const SANDBOXES = [
77
'vue',
88
'svelte',
99
'react-ts',
10-
{ id: 'github/reduxjs/redux/tree/master/examples/todomvc', threshold: 0.04 },
10+
{ id: 'reduxjs-redux-examples-todomvc', threshold: 0.04 },
1111
'vVoQVk78',
12-
'github/faceyspacey/redux-first-router-codesandbox/tree/master',
12+
'faceyspacey-redux-first-router-codesandbox',
1313
'mZRjw05yp',
1414
'o29j95wx9',
1515
'k3q1zjjml5',
16-
'github/reduxjs/redux/tree/master/examples/real-world',
17-
'github/CompuIves/codesandbox-presentation',
16+
'reduxjs-redux-examples-real-world',
17+
'CompuIves-codesandbox-presentation',
1818
'lp5rjr0z4z',
1919
'nOymMxyY',
2020
'y26rj99yov', // react transition
2121
'6w66jzw3mn', // material-design & preact
2222
'4j7m47vlm4', // material-ui
23-
'github/cssinjs/egghead/tree/master/from-sass-to-cssinjs/templates-and-variables', // postcss egghead
23+
'cssinjs-egghead-templates-and-variables', // postcss egghead
2424
'xp5qy8r93q', // babel example
2525
'angular', // angular template
2626
// Sass importing
2727
'2ppkvzx570', // nested imports
2828
'rl2m3xklyo', // node_modules import
2929
'vanilla',
3030
'n5wy74w8vl', // material-ui generated demo
31-
'github/algolia/doc-onboarding/tree/master/demos/angular/media', // algolia angular demo
31+
'algolia-doc-onboarding-demos-angular-media', // algolia angular demo
3232
{ id: 'ymjwwrw2rj', threshold: 0.05 }, // empty path
3333
{ id: '98o3k45m8p', threshold: 0.05 }, // direct path test
3434
'pm79km5lmj', // babel macros with styled components
@@ -39,6 +39,7 @@ const SANDBOXES = [
3939
'zx22owojr3', // vue v-slot test
4040
'4888omqqz7', // material-ui https://github.com/codesandbox/codesandbox-client/issues/1741
4141
];
42+
const SANDBOXES_REPO = 'codesandbox/integration-sandboxes';
4243

4344
function pageLoaded(page) {
4445
return new Promise(async resolve => {
@@ -50,6 +51,10 @@ function pageLoaded(page) {
5051
});
5152
}
5253

54+
function sandboxUrl(sandboxId) {
55+
return `http://localhost:3002/#github/${SANDBOXES_REPO}/tree/master/${sandboxId}`;
56+
}
57+
5358
function loadSandbox(page, sandboxId, timeout) {
5459
return new Promise(async (resolve, reject) => {
5560
const timer = setTimeout(async () => {
@@ -60,7 +65,7 @@ function loadSandbox(page, sandboxId, timeout) {
6065
)
6166
);
6267
}, timeout);
63-
page.goto(`http://localhost:3002/#${sandboxId}`, {
68+
page.goto(sandboxUrl(sandboxId), {
6469
timeout: 0, // we manage the timeout ourselves
6570
});
6671
await pageLoaded(page);

0 commit comments

Comments
 (0)