File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -900,6 +900,19 @@ export class App {
900900 await page . goto ( this . url ) ;
901901 }
902902
903+ /**
904+ * Navigate to the URL defined by options.
905+ *
906+ * Only needed to test initialization scenarios when options has been
907+ * changed by the test.
908+ */
909+ async gotoOptionsUrl ( ) {
910+ let page = await this . page ;
911+ // Allow testing fragment changes by actually navigating away.
912+ await page . goto ( "about:blank" ) ;
913+ return page . goto ( this . url ) ;
914+ }
915+
903916 /**
904917 * Wait for matching completion options to appear.
905918 */
Original file line number Diff line number Diff line change 55 */
66import { App } from "./app" ;
77
8+ const heartMigrationFragment =
9+ "#project:XQAAgACRAAAAAAAAAAA9iImmlGSt1R++5LD+ZJ36cRz46B+lhYtNRoWF0nijpaVyZlK7ACfSpeoQpgfk21st4ty06R4PEOM4sSAXBT95G3en+tghrYmE+YJp6EiYgzA9ThKkyShWq2UdvmCzqxoNfYc1wlmTqlNv/Piaz3WoSe3flvr/ItyLl0aolQlEpv4LA8A=" ;
10+
11+ const sunlightSensorMigrationFragment =
12+ "#project:XQAAgAByAQAAAAAAAAA9iImmlGSt1R++5LD+ZJ36cRz46B+lhYtNRoWF0nijpaVyZlK7ACfSpeoQpgfk21st4ty06R4PEOW6kOsIEMK7SL0Qco7jgsHFKZXfjv/XcHWvXG9qyz1a/a3NUulFDj/FDJxVAIV+WZLpRoo4E6MbW70FOgIfBPWP2hDVsojpoLc7ZfKI8SHxv54FSfB5bkbzaAKO+8CO73t6Odtv691JGjJ9MExFighY6GxyM/DoNInDDpAjFeaqCWrYdwENX7ZVM3we8f4swI71tL28N7sg588aB//A78AA" ;
13+
814describe ( "Browser - migration" , ( ) => {
915 const app = new App ( {
10- fragment :
11- "#project:XQAAgACRAAAAAAAAAAA9iImmlGSt1R++5LD+ZJ36cRz46B+lhYtNRoWF0nijpaVyZlK7ACfSpeoQpgfk21st4ty06R4PEOM4sSAXBT95G3en+tghrYmE+YJp6EiYgzA9ThKkyShWq2UdvmCzqxoNfYc1wlmTqlNv/Piaz3WoSe3flvr/ItyLl0aolQlEpv4LA8A=" ,
16+ fragment : heartMigrationFragment ,
1217 } ) ;
1318 beforeEach ( app . reset . bind ( app ) ) ;
1419 afterEach ( app . screenshot . bind ( app ) ) ;
@@ -19,5 +24,13 @@ describe("Browser - migration", () => {
1924 await app . findVisibleEditorContents (
2025 "from microbit import *\ndisplay.show(Image.HEART)"
2126 ) ;
27+
28+ // Regression test: Check that we can switch to a different migration in the same session.
29+ // Previously we ignored the migration because we already had content in session storage.
30+ app . setOptions ( {
31+ fragment : sunlightSensorMigrationFragment ,
32+ } ) ;
33+ await app . gotoOptionsUrl ( ) ;
34+ await app . findVisibleEditorContents ( "display.read_light_level" ) ;
2235 } ) ;
2336} ) ;
You can’t perform that action at this time.
0 commit comments