-
Notifications
You must be signed in to change notification settings - Fork 614
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
Gantt: fix state of 'Show Resources' and 'Show Dependencies' buttons (T1264485) #28904
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
/* eslint-disable no-restricted-syntax */ | ||
import { createScreenshotsComparer } from 'devextreme-screenshot-comparer'; | ||
import Guid from 'devextreme/core/guid'; | ||
import { Selector } from 'testcafe'; | ||
import { testScreenshot } from '../../helpers/themeUtils'; | ||
import url from '../../helpers/getPageUrl'; | ||
import { createWidget } from '../../helpers/createWidget'; | ||
import { appendElementTo } from '../../helpers/domUtils'; | ||
|
||
const TOOLBAR_ITEM_BUTTON = '.dx-button'; | ||
|
||
fixture.disablePageReloads`Gantt` | ||
.page(url(__dirname, '../container.html')); | ||
|
||
const data = { | ||
tasks: [{ | ||
id: 1, | ||
parentId: 0, | ||
title: 'Software Development', | ||
start: new Date('2019-02-21T05:00:00.000Z'), | ||
end: new Date('2019-07-04T12:00:00.000Z'), | ||
progress: 31, | ||
color: 'red', | ||
}, { | ||
id: 2, | ||
parentId: 1, | ||
title: 'Scope', | ||
start: new Date('2019-02-21T05:00:00.000Z'), | ||
end: new Date('2019-02-26T09:00:00.000Z'), | ||
progress: 60, | ||
}, { | ||
id: 3, | ||
parentId: 2, | ||
title: 'Determine project scope', | ||
start: new Date('2019-02-21T05:00:00.000Z'), | ||
end: new Date('2019-02-21T09:00:00.000Z'), | ||
progress: 100, | ||
}, { | ||
id: 4, | ||
parentId: 2, | ||
title: 'Secure project sponsorship', | ||
start: new Date('2019-02-21T10:00:00.000Z'), | ||
end: new Date('2019-02-22T09:00:00.000Z'), | ||
progress: 100, | ||
}, { | ||
id: 5, | ||
parentId: 2, | ||
title: 'Define preliminary resources', | ||
start: new Date('2019-02-22T10:00:00.000Z'), | ||
end: new Date('2019-02-25T09:00:00.000Z'), | ||
progress: 60, | ||
}, { | ||
id: 6, | ||
parentId: 2, | ||
title: 'Secure core resources', | ||
start: new Date('2019-02-25T10:00:00.000Z'), | ||
end: new Date('2019-02-26T09:00:00.000Z'), | ||
progress: 0, | ||
}, { | ||
id: 7, | ||
parentId: 2, | ||
title: 'Scope complete', | ||
start: new Date('2019-02-26T09:00:00.000Z'), | ||
end: new Date('2019-02-26T09:00:00.000Z'), | ||
progress: 0, | ||
}], | ||
|
||
dependencies: [{ | ||
id: 0, | ||
predecessorId: 1, | ||
successorId: 2, | ||
type: 0, | ||
}, { | ||
id: 1, | ||
predecessorId: 2, | ||
successorId: 3, | ||
type: 0, | ||
}, { | ||
id: 2, | ||
predecessorId: 3, | ||
successorId: 4, | ||
type: 0, | ||
}, { | ||
id: 3, | ||
predecessorId: 4, | ||
successorId: 5, | ||
type: 0, | ||
}, { | ||
id: 4, | ||
predecessorId: 5, | ||
successorId: 6, | ||
type: 0, | ||
}, { | ||
id: 5, | ||
predecessorId: 6, | ||
successorId: 7, | ||
type: 0, | ||
}], | ||
|
||
resources: [{ | ||
id: 1, text: 'Management', | ||
}, { | ||
id: 2, text: 'Project Manager', | ||
}, { | ||
id: 3, text: 'Deployment Team', | ||
}], | ||
|
||
resourceAssignments: [{ | ||
id: 0, taskId: 3, resourceId: 1, | ||
}, { | ||
id: 1, taskId: 4, resourceId: 1, | ||
}, { | ||
id: 2, taskId: 5, resourceId: 2, | ||
}, { | ||
id: 3, taskId: 6, resourceId: 2, | ||
}, { | ||
id: 4, taskId: 6, resourceId: 3, | ||
}], | ||
}; | ||
|
||
test('Gantt - show resources button should not have focus state (T1264485)', async (t) => { | ||
const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
await t | ||
.click(Selector(TOOLBAR_ITEM_BUTTON)); | ||
await testScreenshot(t, takeScreenshot, 'Gantt show resourced.png', { element: '#container' }); | ||
await t | ||
.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}).before(async () => { | ||
const id = `${new Guid()}`; | ||
await appendElementTo('#container', 'div', id, {}); | ||
await createWidget('dxGantt', { | ||
tasks: { dataSource: data.tasks }, | ||
toolbar: { items: ['showResources'] }, | ||
dependencies: { dataSource: data.dependencies }, | ||
resources: { dataSource: data.resources }, | ||
resourceAssignments: { dataSource: data.resourceAssignments }, | ||
}, `#${id}`); | ||
}); | ||
|
||
test('Gantt - show dependencies button should not have focus state (T1264485)', async (t) => { | ||
const { takeScreenshot, compareResults } = createScreenshotsComparer(t); | ||
await t | ||
.click(Selector(TOOLBAR_ITEM_BUTTON)); | ||
await testScreenshot(t, takeScreenshot, 'Gantt show dependencies.png', { element: '#container' }); | ||
await t | ||
.expect(compareResults.isValid()) | ||
.ok(compareResults.errorMessages()); | ||
}).before(async () => { | ||
const id = `${new Guid()}`; | ||
await appendElementTo('#container', 'div', id, {}); | ||
await createWidget('dxGantt', { | ||
tasks: { dataSource: data.tasks }, | ||
toolbar: { items: ['showDependencies'] }, | ||
dependencies: { dataSource: data.dependencies }, | ||
resources: { dataSource: data.resources }, | ||
resourceAssignments: { dataSource: data.resourceAssignments }, | ||
}, `#${id}`); | ||
}); |
Binary file added
BIN
+41.2 KB
...cafe-devextreme/tests/gantt/etalons/Gantt show dependencies (generic-light).png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+32.2 KB
...estcafe-devextreme/tests/gantt/etalons/Gantt show resourced (generic-light).png
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
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,7 @@ | ||
import type { WidgetName } from './types'; | ||
import Widget from './internal/widget'; | ||
|
||
export default class Gantt extends Widget { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like this class is not used. Let's delete it |
||
// eslint-disable-next-line class-methods-use-this | ||
getName(): WidgetName { return 'dxGantt'; } | ||
} |
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 |
---|---|---|
|
@@ -66,7 +66,8 @@ export type WidgetName = | |
| 'dxTreeList' | ||
| 'dxTreeView' | ||
| 'dxValidationSummary' | ||
| 'dxValidator'; | ||
| 'dxValidator' | ||
| 'dxGantt'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's also add gantt to |
||
|
||
export interface WidgetOptions { | ||
dxDataGrid: DataGridProperties; | ||
|
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.