From d4cdd0d56682c0754e61b9700e55aa05d3fa3182 Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Wed, 5 Jun 2024 09:28:41 +0200 Subject: [PATCH 1/3] add failing test for @starting-style --- src/__tests__/to-have-style.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/__tests__/to-have-style.js b/src/__tests__/to-have-style.js index 5991a7e..f151368 100644 --- a/src/__tests__/to-have-style.js +++ b/src/__tests__/to-have-style.js @@ -251,4 +251,33 @@ describe('.toHaveStyle', () => { }) }) }) + + describe('css-features', () => { + test('works with starting-style', () => { + const {container} = render(` +
+ Hello World +
+ `) + + const style = document.createElement('style') + style.innerHTML = ` + @starting-style { + .label { + opacity: 0; + } + } + .label { + opacity: 1; + transition: opacity 0.2s ease-out; + } + ` + document.body.appendChild(style) + document.body.appendChild(container) + + expect(container.querySelector('.label')).toHaveStyle(` + opacity: 1; + `) + }) + }) }) From b1f596b27cffd6e6b30b47922667aa1921e03c91 Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Wed, 5 Jun 2024 09:46:41 +0200 Subject: [PATCH 2/3] upgrade @adobe/css-tools --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f63fbb0..3fced2b 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "author": "Ernesto Garcia (http://gnapse.github.io)", "license": "MIT", "dependencies": { - "@adobe/css-tools": "^4.3.2", + "@adobe/css-tools": "^4.4.0", "@babel/runtime": "^7.9.2", "aria-query": "^5.0.0", "chalk": "^3.0.0", From 08a567c1257bf4e1dd2395cd715c3fefad54ee82 Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Wed, 5 Jun 2024 09:47:04 +0200 Subject: [PATCH 3/3] remove test as it requires jsdom 24 to pass --- src/__tests__/to-have-style.js | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/src/__tests__/to-have-style.js b/src/__tests__/to-have-style.js index f151368..5991a7e 100644 --- a/src/__tests__/to-have-style.js +++ b/src/__tests__/to-have-style.js @@ -251,33 +251,4 @@ describe('.toHaveStyle', () => { }) }) }) - - describe('css-features', () => { - test('works with starting-style', () => { - const {container} = render(` -
- Hello World -
- `) - - const style = document.createElement('style') - style.innerHTML = ` - @starting-style { - .label { - opacity: 0; - } - } - .label { - opacity: 1; - transition: opacity 0.2s ease-out; - } - ` - document.body.appendChild(style) - document.body.appendChild(container) - - expect(container.querySelector('.label')).toHaveStyle(` - opacity: 1; - `) - }) - }) })