['/build/manager-extra.js', 'https://cdn.example.com/x.js', 'javascript:alert(1)', '//evil.example/x.js', 'http://plain.example/x.js', '/a b.js']]); $this->actingAs(makeUser(superAdmin: true)); $html = $this->get('/manager')->assertOk()->getContent(); expect($html)->toContain('"extensions":["/build/manager-extra.js","https://cdn.example.com/x.js"]'); expect($html)->toContain('type="importmap"')->and($html)->toContain('/manager/_assets/vue.js') ->and($html)->not->toContain('javascript:alert')->and($html)->not->toContain('evil.example')->and($html)->not->toContain('plain.example'); }); it('has no import map when the site has no bundle', function () { $this->actingAs(makeUser(superAdmin: true)); expect($this->get('/manager')->getContent())->not->toContain('importmap'); }); it('serves the vue shim and the screens', function () { $this->get('/manager/_assets/vue.js')->assertOk()->assertHeader('Content-Type', 'application/javascript'); $this->get('/manager/_assets/manager.js')->assertOk(); $this->get('/manager/_assets/other.js')->assertNotFound(); });