diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-17 15:08:29 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-17 15:08:29 +0000 |
commit | 6c26db46b89172c15ae7b27d938db643721d59cb (patch) | |
tree | ac2f4401213bba4220e205798396f3442a21f4cd /spec/frontend/__helpers__ | |
parent | 6b97ea1f8008a7ddb22b1faa03496cf46c546c05 (diff) | |
download | gitlab-ce-6c26db46b89172c15ae7b27d938db643721d59cb.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/__helpers__')
-rw-r--r-- | spec/frontend/__helpers__/init_vue_mr_page_helper.js | 18 | ||||
-rw-r--r-- | spec/frontend/__helpers__/matchers/to_have_sprite_icon.js | 2 |
2 files changed, 10 insertions, 10 deletions
diff --git a/spec/frontend/__helpers__/init_vue_mr_page_helper.js b/spec/frontend/__helpers__/init_vue_mr_page_helper.js index ee01e9e6268..6b719a32480 100644 --- a/spec/frontend/__helpers__/init_vue_mr_page_helper.js +++ b/spec/frontend/__helpers__/init_vue_mr_page_helper.js @@ -13,16 +13,16 @@ export default function initVueMRPage() { const diffsAppProjectPath = 'testproject'; const mrEl = document.createElement('div'); mrEl.className = 'merge-request fixture-mr'; - mrEl.setAttribute('data-mr-action', 'diffs'); + mrEl.dataset.mrAction = 'diffs'; mrTestEl.appendChild(mrEl); const mrDiscussionsEl = document.createElement('div'); mrDiscussionsEl.id = 'js-vue-mr-discussions'; - mrDiscussionsEl.setAttribute('data-current-user-data', JSON.stringify(userDataMock)); - mrDiscussionsEl.setAttribute('data-noteable-data', JSON.stringify(noteableDataMock)); - mrDiscussionsEl.setAttribute('data-notes-data', JSON.stringify(notesDataMock)); - mrDiscussionsEl.setAttribute('data-noteable-type', 'merge-request'); - mrDiscussionsEl.setAttribute('data-is-locked', 'false'); + mrDiscussionsEl.dataset.currentUserData = JSON.stringify(userDataMock); + mrDiscussionsEl.dataset.noteableData = JSON.stringify(noteableDataMock); + mrDiscussionsEl.dataset.notesData = JSON.stringify(notesDataMock); + mrDiscussionsEl.dataset.noteableType = 'merge-request'; + mrDiscussionsEl.dataset.isLocked = 'false'; mrTestEl.appendChild(mrDiscussionsEl); const discussionCounterEl = document.createElement('div'); @@ -31,9 +31,9 @@ export default function initVueMRPage() { const diffsAppEl = document.createElement('div'); diffsAppEl.id = 'js-diffs-app'; - diffsAppEl.setAttribute('data-endpoint', diffsAppEndpoint); - diffsAppEl.setAttribute('data-project-path', diffsAppProjectPath); - diffsAppEl.setAttribute('data-current-user-data', JSON.stringify(userDataMock)); + diffsAppEl.dataset.endpoint = diffsAppEndpoint; + diffsAppEl.dataset.projectPath = diffsAppProjectPath; + diffsAppEl.dataset.currentUserData = JSON.stringify(userDataMock); mrTestEl.appendChild(diffsAppEl); const mock = new MockAdapter(axios); diff --git a/spec/frontend/__helpers__/matchers/to_have_sprite_icon.js b/spec/frontend/__helpers__/matchers/to_have_sprite_icon.js index bce9d93bea8..45b9c31c4db 100644 --- a/spec/frontend/__helpers__/matchers/to_have_sprite_icon.js +++ b/spec/frontend/__helpers__/matchers/to_have_sprite_icon.js @@ -9,7 +9,7 @@ export const toHaveSpriteIcon = (element, iconName) => { const iconReferences = [].slice.apply(element.querySelectorAll('svg use')); const matchingIcon = iconReferences.find( - (reference) => reference.parentNode.getAttribute('data-testid') === `${iconName}-icon`, + (reference) => reference.parentNode.dataset.testid === `${iconName}-icon`, ); const pass = Boolean(matchingIcon); |