Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
logging-scratch-gui
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
David Goessmann
logging-scratch-gui
Commits
dde9361a
Commit
dde9361a
authored
6 years ago
by
Paul Kaplan
Browse files
Options
Downloads
Patches
Plain Diff
Prevent crash after deleting sprite that had been highlighted
parent
5f10ba94
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/containers/target-highlight.jsx
+2
-1
2 additions, 1 deletion
src/containers/target-highlight.jsx
test/integration/stage-size.test.js
+47
-0
47 additions, 0 deletions
test/integration/stage-size.test.js
with
49 additions
and
1 deletion
src/containers/target-highlight.jsx
+
2
−
1
View file @
dde9361a
...
...
@@ -32,7 +32,8 @@ class TargetHighlight extends React.Component {
vm
}
=
this
.
props
;
if
(
!
(
highlightedTargetId
&&
vm
&&
vm
.
renderer
))
return
null
;
if
(
!
(
highlightedTargetId
&&
vm
&&
vm
.
renderer
&&
vm
.
runtime
.
getTargetById
(
highlightedTargetId
)))
return
null
;
const
target
=
vm
.
runtime
.
getTargetById
(
highlightedTargetId
);
const
bounds
=
vm
.
renderer
.
getBounds
(
target
.
drawableID
);
...
...
This diff is collapsed.
Click to expand it.
test/integration/stage-size.test.js
0 → 100644
+
47
−
0
View file @
dde9361a
import
path
from
'
path
'
;
import
SeleniumHelper
from
'
../helpers/selenium-helper
'
;
const
{
clickText
,
clickXpath
,
rightClickText
,
getDriver
,
getLogs
,
loadUri
,
scope
}
=
new
SeleniumHelper
();
const
uri
=
path
.
resolve
(
__dirname
,
'
../../build/index.html
'
);
let
driver
;
describe
(
'
Loading scratch gui
'
,
()
=>
{
beforeAll
(()
=>
{
driver
=
getDriver
();
});
afterAll
(
async
()
=>
{
await
driver
.
quit
();
});
test
(
'
Switching small/large stage after highlighting and deleting sprite
'
,
async
()
=>
{
await
loadUri
(
uri
);
await
clickXpath
(
'
//button[@title="Try It"]
'
);
// Highlight the sprite
await
clickText
(
'
Sprite1
'
,
scope
.
spriteTile
);
// Delete it
await
rightClickText
(
'
Sprite1
'
,
scope
.
spriteTile
);
await
clickText
(
'
delete
'
,
scope
.
spriteTile
);
// Go to small stage mode
await
clickXpath
(
'
//img[@alt="Switch to small stage"]
'
);
// Confirm app still working
await
clickXpath
(
'
//img[@alt="Switch to large stage"]
'
);
const
logs
=
await
getLogs
();
await
expect
(
logs
).
toEqual
([]);
});
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment