-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: drawing tile navigator panel (PT-185987214) #2416
Merged
Merged
Changes from 25 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e134304
feat: drawing tile navigator panel (PT-185987214)
emcelroy c12a82e
chore: move toolbar button component to shared location
emcelroy 8bb86f2
Merge branch 'master' into 185987214-drawing-tile-navigator-panel
emcelroy 37cf963
Merge branch 'master' into 185987214-drawing-tile-navigator-panel
emcelroy cdc1641
chore: refactor drawing tile tests
emcelroy dd41f05
refactor: add navigatable tile model, save navigator position, use re…
emcelroy afe2666
fix: drawing elements clipped by viewport boundaries
emcelroy 0598cc9
update class users in place
scytacki 40f0c20
Switch to using the MST environment for the groups store
scytacki d7d950b
Sync the group membership
scytacki ab627ff
look up users instead of copying full name and initials
scytacki c000b36
switch authAndConnect to async await
scytacki 670d5cd
add support for removed users
scytacki 25ab4e3
portal service object and refresh class info
scytacki fa18fa6
hide users removed from the class
scytacki bac6d5b
kick removed users out of groups first
scytacki 9fc990c
add test of removed users
scytacki d00a822
chore: update drawing test snapshots
emcelroy d3f4af9
fix: increase wait for animation
emcelroy 2b8f966
Merge branch 'master' into 185987214-drawing-tile-navigator-panel
emcelroy 1c688a6
chore: update non-legacy drawing test snapshots
emcelroy bf64e8a
refactor: simplify showing elements outside viewport
emcelroy 58c7e68
Merge branch 'master' into 185987214-drawing-tile-navigator-panel
emcelroy 8f1ffcf
chore: remove plugin dependencies,
emcelroy 953cef8
Merge branch 'master' into 185987214-drawing-tile-navigator-panel
emcelroy e50c2a4
chore: remove IDrawingTileProps import
emcelroy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import ClueCanvas from "../../../support/elements/common/cCanvas"; | ||
import TileNavigator from "../../../support/elements/tile/TileNavigator"; | ||
import DrawToolTile from "../../../support/elements/tile/DrawToolTile"; | ||
import { LogEventName } from "../../../../src/lib/logger-types"; | ||
|
||
let clueCanvas = new ClueCanvas, | ||
drawToolTile = new DrawToolTile, | ||
tileNavigator = new TileNavigator; | ||
|
||
function beforeTest() { | ||
const queryParams = `${Cypress.config("qaUnitStudent5")}`; | ||
cy.visit(queryParams); | ||
cy.waitForLoad(); | ||
cy.showOnlyDocumentWorkspace(); | ||
} | ||
|
||
context("Tile Navigator", () => { | ||
it("renders with a draw tool tile by default", () => { | ||
beforeTest(); | ||
|
||
clueCanvas.addTile("drawing"); | ||
drawToolTile.getDrawTile().should("exist"); | ||
tileNavigator.getTileNavigator().should("exist"); | ||
|
||
clueCanvas.toolbarButtonIsEnabled("drawing", "navigator"); | ||
clueCanvas.getToolbarButtonToolTip("drawing", "navigator").should("exist"); | ||
clueCanvas.getToolbarButtonToolTipText("drawing", "navigator").should("eq", "Hide Navigator"); | ||
|
||
cy.log("Draw a rectangle"); | ||
drawToolTile.drawRectangle(100, 50, 20, 20); | ||
tileNavigator.getRectangleDrawing().should("exist").and("have.length", 1); | ||
}); | ||
it("can be hidden and shown", () => { | ||
beforeTest(); | ||
|
||
cy.window().then(win => { | ||
cy.stub(win.ccLogger, "log").as("log"); | ||
}); | ||
|
||
clueCanvas.addTile("drawing"); | ||
cy.log("Hide tile navigator"); | ||
clueCanvas.clickToolbarButton("drawing", "navigator"); | ||
clueCanvas.getToolbarButtonToolTipText("drawing", "navigator").should("eq", "Show Navigator"); | ||
tileNavigator.getTileNavigator().should("not.exist"); | ||
cy.get("@log") | ||
.should("have.been.been.calledWith", LogEventName.DRAWING_TOOL_CHANGE, Cypress.sinon.match.object) | ||
.its("lastCall.args.1").should("deep.include", { operation: "hideNavigator" }); | ||
|
||
cy.log("Show tile navigator"); | ||
clueCanvas.clickToolbarButton("drawing", "navigator"); | ||
clueCanvas.getToolbarButtonToolTipText("drawing", "navigator").should("eq", "Hide Navigator"); | ||
tileNavigator.getTileNavigator().should("exist"); | ||
cy.get("@log") | ||
.should("have.been.been.calledWith", LogEventName.DRAWING_TOOL_CHANGE, Cypress.sinon.match.object) | ||
.its("lastCall.args.1").should("deep.include", { operation: "showNavigator" }); | ||
}); | ||
it("is at the bottom of the drawing tile by default but can be moved to the top", () => { | ||
beforeTest(); | ||
|
||
clueCanvas.addTile("drawing"); | ||
tileNavigator.getTileNavigator().should("exist").and("not.have.class", "top"); | ||
|
||
cy.log("Move tile navigator to the top of the drawing tile in a quick animation"); | ||
tileNavigator.getTileNavigatorPlacementButton().click(); | ||
cy.wait(300); | ||
tileNavigator.getTileNavigatorContainer().should("have.class", "top"); | ||
|
||
cy.log("Move tile navigator to the bottom of the drawing tile in a quick animation"); | ||
tileNavigator.getTileNavigatorPlacementButton().click(); | ||
cy.wait(300); | ||
tileNavigator.getTileNavigatorContainer().should("not.have.class", "top"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
class TileNavigator { | ||
getTileNavigator() { | ||
return cy.get('.primary-workspace [data-testid=tile-navigator]'); | ||
} | ||
getTileNavigatorContainer() { | ||
return cy.get('.primary-workspace [data-testid=tile-navigator-container]'); | ||
} | ||
getTileNavigatorPlacementButton() { | ||
return cy.get('.primary-workspace [data-testid=tile-navigator-placement-button]'); | ||
} | ||
getRectangleDrawing(){ | ||
return cy.get('.primary-workspace [data-testid=tile-navigator-container] .drawing-layer svg rect.rectangle'); | ||
} | ||
} | ||
|
||
export default TileNavigator; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -293,6 +293,7 @@ | |
"zoom-in", | ||
"zoom-out", | ||
"fit-all", | ||
"navigator", | ||
"|", | ||
"duplicate", | ||
"delete" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't need the explicit
wait
here (or in line 70), since Cypress will automatically wait up to its timeout for a condition to become true.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that's true generally, but found these were required to make the test pass consistently. I believe it has something to do with how the component waits for the animation to complete before updating the model which is what causes the class name to change. I'm not sure why explicitly setting a wait makes it always work. I did spend some time looking into it but wasn't able to figure out a way to make them unnecessary. For now at least I'd like to leave them so I can complete the main task.