Commit f8660cde authored by sarahghp's avatar sarahghp

Adds additional data attr for toolbar

It also updates the test.
parent d14bce5b
...@@ -49,6 +49,7 @@ export default { ...@@ -49,6 +49,7 @@ export default {
required: false, required: false,
default: () => ({ default: () => ({
sourceProjectId: '', sourceProjectId: '',
sourceProjectPath: '',
mergeRequestId: '', mergeRequestId: '',
appUrl: '', appUrl: '',
}), }),
......
...@@ -53,6 +53,7 @@ export default { ...@@ -53,6 +53,7 @@ export default {
appUrl: this.mr.appUrl, appUrl: this.mr.appUrl,
mergeRequestId: this.mr.iid, mergeRequestId: this.mr.iid,
sourceProjectId: this.mr.sourceProjectId, sourceProjectId: this.mr.sourceProjectId,
sourceProjectPath: this.mr.sourceProjectFullPath,
}; };
}, },
pipeline() { pipeline() {
......
...@@ -37,6 +37,7 @@ export default { ...@@ -37,6 +37,7 @@ export default {
return { return {
script: `<script defer script: `<script defer
data-project-id='${this.appMetadata.sourceProjectId}' data-project-id='${this.appMetadata.sourceProjectId}'
data-project-path='${this.appMetadata.sourceProjectPath}'
data-merge-request-id='${this.appMetadata.mergeRequestId}' data-merge-request-id='${this.appMetadata.mergeRequestId}'
data-mr-url='${this.appMetadata.appUrl}' data-mr-url='${this.appMetadata.appUrl}'
id='review-app-toolbar-script' id='review-app-toolbar-script'
......
...@@ -16,6 +16,7 @@ describe('Visual Review App Link', () => { ...@@ -16,6 +16,7 @@ describe('Visual Review App Link', () => {
mergeRequestId: 1, mergeRequestId: 1,
sourceProjectId: 20, sourceProjectId: 20,
appUrl: 'http://gitlab.example.com', appUrl: 'http://gitlab.example.com',
sourceProjectPath: 'source/project',
}, },
link: 'http://example.com', link: 'http://example.com',
}; };
...@@ -58,6 +59,12 @@ describe('Visual Review App Link', () => { ...@@ -58,6 +59,12 @@ describe('Visual Review App Link', () => {
); );
}); });
it('with expected project path', () => {
expect(wrapper.find(GlModal).text()).toEqual(
expect.stringContaining(`data-project-path='${propsData.appMetadata.sourceProjectPath}'`),
);
});
it('with expected merge request id', () => { it('with expected merge request id', () => {
expect(wrapper.find(GlModal).text()).toEqual( expect(wrapper.find(GlModal).text()).toEqual(
expect.stringContaining(`data-merge-request-id='${propsData.appMetadata.mergeRequestId}'`), expect.stringContaining(`data-merge-request-id='${propsData.appMetadata.mergeRequestId}'`),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment