Skip to content

Commit

Permalink
Merge pull request #204 from BonnierNews/update-audio-element
Browse files Browse the repository at this point in the history
Add load() method to audio element
  • Loading branch information
JesperZachrisson authored Dec 8, 2023
2 parents cda2f81 + f72916c commit 55d3ae2
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Changelog
=========

## 15.4.0

- Add load() method to audio element

## 15.3.0

- Support audio element
Expand Down
2 changes: 1 addition & 1 deletion docs/API.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- version -->
# 15.3.0 API Reference
# 15.4.0 API Reference
<!-- versionstop -->

<!-- toc -->
Expand Down
1 change: 1 addition & 0 deletions lib/HTMLAudioElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = class HTMLAudioElement extends HTMLElement {
pause() {
this.paused = true;
}
load() {}
_setDuration(duration) {
this.duration = duration;
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@expressen/tallahassee",
"version": "15.3.0",
"version": "15.4.0",
"description": "Lightweight client testing framework",
"main": "index.js",
"license": "BSD-3-Clause",
Expand Down
12 changes: 12 additions & 0 deletions test/elements-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1442,6 +1442,17 @@ describe("elements", () => {
expect(returnValue).to.be.undefined;
});

it("has a load method", () => {
const audioElement = document.getElementById("audio-element");
expect(typeof audioElement.load === "function").to.be.true;
});

it("the load method returns undefined", () => {
const audioElement = document.getElementById("audio-element");
const returnValue = audioElement.load();
expect(returnValue).to.be.undefined;
});

it("has a _setDuration method", () => {
const audioElement = document.getElementById("audio-element");
expect(typeof audioElement._setDuration === "function").to.be.true;
Expand All @@ -1452,6 +1463,7 @@ describe("elements", () => {
audioElement._setDuration(50);
expect(audioElement).to.have.property("duration", 50);
});

});

describe("template element", () => {
Expand Down

0 comments on commit 55d3ae2

Please sign in to comment.