Skip to content

Commit

Permalink
Chore: Move access token to environment variable (#785)
Browse files Browse the repository at this point in the history
  • Loading branch information
pramodsum authored May 15, 2018
1 parent 2124b3c commit 2f446cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 4 additions & 2 deletions functional-tests/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,13 @@ exports.disableDash = (I) => {
});
};
exports.showPreview = (I, fileId = FILE_ID_DOC, options = {}) => {
const { ACCESS_TOKEN } = process.env;
I.executeScript(
function(previewFileId, previewOptions) {
window.showPreview(previewFileId, previewOptions);
function(previewFileId, accessToken, previewOptions) {
window.showPreview(previewFileId, accessToken, previewOptions);
},
fileId,
ACCESS_TOKEN,
options
);

Expand Down
6 changes: 2 additions & 4 deletions functional-tests/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@
<body>
<div class="preview-container"></div>
<script>
var ACCESS_TOKEN = 'edRiUpeLD9A1nLyWqc1gZOt2OnSNNYp9';
var preview = new Box.Preview();

function showPreview(fileId, options) {
function showPreview(fileId, token, options) {
options = options || {};
options.container = '.preview-container';
preview.show(fileId, ACCESS_TOKEN, options);
preview.show(fileId, token, options);
}
</script>
</body>
Expand Down

0 comments on commit 2f446cc

Please sign in to comment.