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 {
required: false,
default: () => ({
sourceProjectId: '',
sourceProjectPath: '',
mergeRequestId: '',
appUrl: '',
}),
......
......@@ -53,6 +53,7 @@ export default {
appUrl: this.mr.appUrl,
mergeRequestId: this.mr.iid,
sourceProjectId: this.mr.sourceProjectId,
sourceProjectPath: this.mr.sourceProjectFullPath,
};
},
pipeline() {
......
......@@ -37,6 +37,7 @@ export default {
return {
script: `<script defer
data-project-id='${this.appMetadata.sourceProjectId}'
data-project-path='${this.appMetadata.sourceProjectPath}'
data-merge-request-id='${this.appMetadata.mergeRequestId}'
data-mr-url='${this.appMetadata.appUrl}'
id='review-app-toolbar-script'
......
......@@ -16,6 +16,7 @@ describe('Visual Review App Link', () => {
mergeRequestId: 1,
sourceProjectId: 20,
appUrl: 'http://gitlab.example.com',
sourceProjectPath: 'source/project',
},
link: 'http://example.com',
};
......@@ -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', () => {
expect(wrapper.find(GlModal).text()).toEqual(
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